Video Shooting Method and Electronic Device

ABSTRACT

A video shooting method includes: enabling a camera function; determining a first video recording template in response to a first operation of a user, where the first video recording template includes a first example sample, a second example sample, and preset audio; maintaining a position of an electronic device and starting video recording in response to a second operation of the user; and automatically generating a synthetic video, where the synthetic video includes a first video clip, a second video clip, and the preset audio, the first video clip is a video clip generated in the first camera movement mode, and the second video clip is a video clip generated in the second camera movement mode. In this manner, a plurality of video clips obtained in various camera movement modes may be synthesized into a video configured with audio.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims priority to Chinese Patent Application No.201911207579.8, filed with the Chinese Patent Office on Nov. 29, 2019and entitled “METHOD FOR DISPLAYING PREVIEW IMAGE IN VIDEO RECORDINGSCENARIO AND ELECTRONIC DEVICE”, which is incorporated herein byreference in its entirety. This application claims priority to ChinesePatent Application No. 202010079012.3, filed with the Chinese PatentOffice on Feb. 3, 2020 and entitled “METHOD FOR DISPLAYING PREVIEW IMAGEIN VIDEO RECORDING SCENARIO AND ELECTRONIC DEVICE”, which isincorporated herein by reference in its entirety. This applicationclaims priority to Chinese Patent Application No. 202011066518.7, filedwith the Chinese Patent Office on Sep. 30, 2020 and entitled “VIDEOSHOOTING METHOD AND ELECTRONIC DEVICE”, which is incorporated herein byreference in its entirety.

TECHNICAL FIELD

This application relates to the field of image shooting technologies,and in particular, to a video shooting method and an electronic device.

BACKGROUND

To improve quality of shooting works, there are various camera movementshooting techniques in the industry, commonly known as “shaking a lens”,“moving a lens”, and the like. A mobile phone is used as an example. Animplementation process of“moving a lens” may be shown, for example, inFIG. 1(a). In an object shooting process, the mobile phone moves in ahorizontal direction. This is “moving a lens”. It is assumed that themobile phone moves from a point A to a point B. In a movement process, apreview image displayed on a display of the mobile phone changes becausecoverage of a camera changes. Certainly, “moving a lens” may alsoinclude “moving a lens” in a vertical direction. An upward movement maymean “ascending a lens”, and a downward movement may mean “descending alens”. An implementation process of “shaking a lens” may be shown, forexample, in FIG. 1(a). In an object shooting process, the mobile phonerotates around a central axis. The central axis is, for example, aperpendicular bisector of a short side of the mobile phone on a plane onwhich the display of the mobile phone is located. If the mobile phonerotates leftward around the central axis, “shaking a lens” leftward isimplemented as shown in FIG. 1(b). If the mobile phone rotates rightwardaround the central axis, “shaking a lens” rightward is implemented asshown in FIG. 1(c).

In other words, if a user needs to implement the foregoing cameramovement shooting technique such as “moving a lens” or “shaking a lens”by using a portable electronic device (for example, a mobile phone), theuser needs to move or rotate the mobile phone. This is inconvenient.

SUMMARY

This application provides a video shooting method and an electronicdevice, to improve convenience of implementing a camera movementshooting manner such as “moving a lens” or “shaking a lens” by using amobile phone.

According to a first aspect, a video shooting method is furtherprovided. The method is applied to an electronic device, and includes:enabling a camera function; determining a first video recording templatein response to a first operation of a user, where the first videorecording template includes a first example sample, a second examplesample, and preset audio, the first example sample corresponds to afirst camera movement mode, the second example sample corresponds to asecond camera movement mode, and the first camera movement mode isdifferent from the second camera movement mode; displaying a videorecording interface, where the video recording interface includes afirst camera movement mode identifier and a second camera movement modeidentifier; keeping a position of the electronic device unchanged andstarting video recording in response to a second operation of the user,and automatically generating a synthetic video, where the syntheticvideo includes a first video clip, a second video clip, and the presetaudio, the first video clip is a video clip generated by the electronicdevice in the first camera movement mode, and the second video clip is avideo clip generated by the electronic device in the second cameramovement mode.

Therefore, in this manner, various video clips obtained in variouscamera movement modes may be synthesized into a video and preset audiomay be configured for the synthetic video, so that a video of relativelygood quality can be obtained through a convenient operation. Thesynthetic video may be directly uploaded to a social network, sent to acontact, and the like, and an excessively complex video processingprocess is not required, so that an operation is simple, and userexperience is relatively good.

In a possible design, the keeping a position of the electronic deviceunchanged and starting video recording in response to a second operationof the user includes: when the first camera movement mode identifier isselected, generating the first video clip in the first camera movementmode in response to a shooting indication by the user, where duration ofthe first video clip is first preset duration; and when the secondcamera movement mode identifier is selected, generating the second videoclip in the second camera movement mode in response to a shootingindication by the user, where duration of the second video clip issecond preset duration.

In other words, for each camera movement mode, the user may controlstart and/or stop of recording. For example, the first video recordingtemplate includes a plurality of camera movement modes. Video recordingduration corresponding to each camera movement mode may be preset fixedduration, to be specific, shooting stops when the preset duration isreached. Alternatively, video recording duration corresponding to eachcamera movement mode may be non-preset duration. For example, the usercontrols, by using a shooting control on a viewfinder interface, amobile phone to start and stop recording in the first camera movementmode.

In a possible design, when the first video clip is generated in thefirst camera movement mode, a countdown of generating the first videoclip in the first camera movement mode is further displayed on the videorecording interface; and when the second video clip is generated in thesecond camera movement mode, a countdown of generating the second videoclip in the second camera movement mode is further displayed on thevideo recording interface.

In other words, the electronic device may display a recording timecountdown, to help the user learn of a recording progress (for example,remaining recording duration), so that interaction experience isrelatively good.

In a possible design, the method further includes: displaying the videorecording interface, where the video recording interface includes thefirst camera movement mode identifier and the second camera movementmode identifier; deleting the first camera movement mode identifier orthe second camera movement mode identifier m response to a thirdoperation of the user; keeping the position of the electronic deviceunchanged and starting recording in response to a fourth operation ofthe user; and automatically generating a synthetic video, where thesynthetic video includes a video clip generated by the electronic devicein a camera movement mode that is not deleted, and the synthetic videofurther includes the preset audio.

In other words, the user may delete a camera movement mode identifier.For example, if the user deletes a camera movement mode identifiercorresponding to a camera movement mode that the user does not like, thecorresponding camera movement mode is deleted, and video clips generatedin camera movement modes corresponding to remaining camera movement modeidentifiers are synthesized into a video.

In a possible design, the method further includes: displaying the videorecording interface, where the video recording interface includes thefirst camera movement mode identifier and the second camera movementmode identifier; adding a third camera movement mode identifier to thevideo recording interface in response to a third operation of the user,where the third camera movement mode identifier is used to indicate athird camera movement mode; keeping the position of the electronicdevice unchanged and starting recording in response to a fourthoperation of the user; and automatically generating a synthetic video,where the synthetic video includes the first video clip, the secondvideo clip, a third video clip, and the preset audio, and the thirdvideo clip is a video clip generated by the electronic device in thethird camera movement mode.

In other words, assuming that the user likes a camera movement mode, theuser may add a camera movement mode identifier corresponding to thecamera movement mode, so that the corresponding camera movement mode isadded, and a video clip generated in an original camera movement modeand a video clip generated in the added camera movement mode aresynthesized into a video.

In a possible design, the method further includes: displaying the videorecording interface, where the video recording interface includes thefirst camera movement mode identifier and the second camera movementmode identifier; adjusting an order of displaying the first cameramovement mode identifier and the second camera movement mode identifierto a first order in response to a third operation of the user; keepingthe position of the electronic device unchanged and starting recordingin response to a fourth operation of the user; and automaticallygenerating a synthetic video, where an order of playing the first videoclip and the second video clip in the synthetic video is the firstorder.

In other words, the user may adjust an order of displaying cameramovement mode identifiers, so that an order of synthesizing video clipsis adjusted, and an order of playing two video clips in a syntheticvideo is also adjusted.

In a possible design, the first example sample and/or the second examplesample are/is displayed on the video recording interface.

On the recording interface, the first example sample is used to help theuser view a shooting effect of the first camera movement mode, and thesecond example sample is used to view a shooting effect of the secondcamera movement mode, so that interaction experience is relatively good.

In a possible design, before the automatically generating a syntheticvideo, the method further includes: displaying a presentation interface,where the presentation interface includes the first video clip and thesecond video clip; and the automatically generating a synthetic videoincludes: performing video synthesizing in response to a videosynthesizing instruction entered by the user.

In other words, before performing video synthesizing, the user mayfurther separately view the first video clip and the second video clip.Assuming that the user is satisfied with the two video clips, videosynthesizing is performed under a trigger operation of the user.

In a possible design, the method further includes: deleting the firstvideo clip or the second video clip in response to the fourth operation;or adding a local third video clip to the synthetic video; or adjustingthe order of playing the first video clip or the second video clip inthe synthetic video.

In other words, the user may delete a video clip, for example, delete ashot clip that the user is not satisfied with; or may locally add avideo clip that the user likes; or may adjust an order of playing twovideo clips in a synthetic video. In conclusion, the user can flexiblyset a synthetic video, so that interaction experience is relativelygood.

In a possible design, the first video recording template is a defaulttemplate or a user-defined template.

In other words, the user not only may use a default template of theelectronic device, but also may customize a template, for example, set atemplate that the user likes, so that interaction experience isrelatively good.

In a possible design, the method further includes: automatically storingthe first video clip, the second video clip, and the synthetic video. Inother words, the electronic device may automatically store all videoclips and a video into which the video clips are synthesized. In thisway, the user may locally view each individual video clip, or may viewthe synthetic video, so that user experience is relatively good. Forexample, the user may upload an individual video clip to the socialnetwork, or may upload the synthetic video to the social network.

In a possible design, the method further includes: in response to aspecific operation, changing audio in the synthetic video, or adding atext and/or a picture to the synthetic video. In other words, the usermay change audio in a synthetic video, or may add a text, a picture, orthe like to a synthetic video, so that interaction experience isrelatively good.

According to a second aspect, an electronic device is further provided.The electronic device includes:

one or more processors; and

one or more memories.

The one or more memories store one or more computer programs, the one ormore computer programs include instructions, and when the instructionsare executed by the one or more processors, the electronic device isenabled to perform the following steps:

enabling a camera function;

determining a first video recording template in response to a firstoperation of a user, where the first video recording template includes afirst example sample, a second example sample, and preset audio, thefirst example sample corresponds to a first camera movement mode, thesecond example sample corresponds to a second camera movement mode, andthe first camera movement mode is different from the second cameramovement mode;

displaying a video recording interface, where the video recordinginterface includes a first camera movement mode identifier and a secondcamera movement mode identifier;

keeping a position of the electronic device unchanged and starting videorecording in response to a second operation of the user; and

automatically generating a synthetic video, where the synthetic videoincludes a first video clip, a second video clip, and the preset audio,the first video clip is a video clip generated by the electronic devicein the first camera movement mode, and the second video clip is a videoclip generated by the electronic device in the second camera movementmode.

In a possible design, when the instructions are executed by the one ormore processors, the electronic device is enabled to specificallyperform the following steps:

when the first camera movement mode identifier is selected, generatingthe first video clip in the first camera movement mode in response to ashooting indication by the user, where duration of the first video clipis first preset duration; and

when the second camera movement mode identifier is selected, generatingthe second video clip in the second camera movement mode in response toa shooting indication by the user, where duration of the second videoclip is second preset duration.

In a possible design, when the instructions are executed by the one ormore processors, the electronic device is enabled to specificallyperform the following steps:

when the first video clip is generated in the first camera movementmode, further displaying, on the video recording interface, a countdownof generating the first video clip in the first camera movement mode,and when the second video clip is generated in the second cameramovement mode, further displaying, on the video recording interface, acountdown of generating the second video clip in the second cameramovement mode.

In a possible design, when the instructions are executed by the one ormore processors, the electronic device is enabled to further perform thefollowing steps:

displaying the video recording interface, where the video recordinginterface includes the first camera movement mode identifier and thesecond camera movement mode identifier;

deleting the first camera movement mode identifier or the second cameramovement mode identifier in response to a third operation of the user;

keeping the position of the electronic device unchanged and startingrecording in response to a fourth operation of the user; and

automatically generating a synthetic video, where the synthetic videoincludes a video clip generated by the electronic device in a cameramovement mode that is not deleted and the preset audio.

In a possible design, when the instructions are executed by the one ormore processors, the electronic device is enabled to further perform thefollowing steps:

displaying the video recording interface, where the video recordinginterface includes the first camera movement mode identifier and thesecond camera movement mode identifier:

adding a third camera movement mode identifier to the video recordinginterface in response to a third operation of the user, where the thirdcamera movement mode identifier is used to indicate a third cameramovement mode:

keeping the position of the electronic device unchanged and startingrecording in response to a fourth operation of the user; and

automatically generating a synthetic video, where the synthetic videoincludes the first video clip, the second video clip, a third videoclip, and the preset audio, and the third video clip is a video clipgenerated by the electronic device in the third camera movement mode.

In a possible design, when the instructions are executed by the one ormore processors, the electronic device is enabled to further perform thefollowing steps:

displaying the video recording interface, where the video recordinginterface includes the first camera movement mode identifier and thesecond camera movement mode identifier:

adjusting an order of displaying the first camera movement modeidentifier and the second camera movement mode identifier to a firstorder in response to a third operation of the user;

keeping the position of the electronic device unchanged and startingrecording in response to a fourth operation of the user; and

automatically generating a synthetic video, where an order of playingthe first video clip and the second video clip in the synthetic video isthe first order.

In a possible design, the first example sample and/or the second examplesample are/is displayed on the video recording interface.

In a possible design, when the instructions are executed by the one ormore processors, the electronic device is enabled to further perform thefollowing step:

displaying a presentation interface, where the presentation interfaceincludes the first video clip and the second video clip; and

the automatically generating a synthetic video includes: performingvideo synthesizing in response to a video synthesizing instructionentered by the user.

In a possible design, when the instructions are executed by the one ormore processors, the electronic device is enabled to further perform thefollowing step:

deleting the first video clip or the second video clip in response tothe fourth operation: or adding a local third video clip to thesynthetic video; or adjusting the order of playing the first video clipor the second video clip in the synthetic video.

In a possible design, the first video recording template is a defaulttemplate or a user-defined template.

In a possible design, when the instructions are executed by the one ormore processors, the electronic device is enabled to further perform thefollowing step:

automatically storing the first video clip, the second video clip, andthe synthetic video.

In a possible design, when the instructions are executed by the one ormore processors, the electronic device is enabled to further perform thefollowing step:

in response to a specific operation, changing audio in the syntheticvideo, or adding a text and/or a picture to the synthetic video.

According to a third aspect, an embodiment of this application furtherprovides an electronic device. The electronic device includesmodules/units that perform the method according to any one of the firstaspect and the possible designs of the first aspect. These modules/unitsmay be implemented by hardware, or may be implemented by hardware byexecuting corresponding software.

According to a fourth aspect, an embodiment of this application furtherprovides a chip. The chip is coupled to a memory in an electronicdevice, and is configured to invoke a computer program stored in thememory and execute the technical solution according to any one of thefirst aspect and the possible designs of the first aspect in embodimentsof this application. In this embodiment of this application, “coupling”means that two components are directly or indirectly combined with eachother.

According to a fifth aspect, a computer-readable storage medium isfurther provided. The computer-readable storage medium includes acomputer program, and when the computer program is run on an electronicdevice, the electronic device is enabled to perform the method accordingto the first aspect.

According to a sixth aspect, a program product is further provided. Theprogram product includes instructions, and when the instructions are runon a computer, the computer is enabled to perform the method accordingto the first aspect.

According to a seventh aspect, a graphical user interface on anelectronic device is further provided. The electronic device includes adisplay, one or more memories, and one or more processors. The one ormore processors are configured to execute one or more computer programsstored in the one or more memories. The graphical user interfaceincludes a graphical user interface displayed when the electronic deviceperforms the method according to the first aspect.

For beneficial effects of the second aspect to the seventh aspect, referto the beneficial effects of the first aspect. Details are not describedagain.

According to an eighth aspect, a method for displaying a preview imagein a video recording scenario is provided. The method is applied to anelectronic device, for example, a mobile phone or a tablet computer. Theelectronic device detects a first operation used to open a cameraapplication; starts the camera application in response to the firstoperation; detects a second operation used to indicate a first videorecording mode; displays a viewfinder interface on a display of theelectronic device in response to the second operation, where theviewfinder interface includes a first preview image, and the firstpreview image is a first image block in a first region on a first imagecaptured by a first wide-angle camera on the electronic device; keeps aposition of the electronic device unchanged, and detects a thirdoperation that indicates an image movement direction; and displays asecond preview image on the viewfinder interface in response to thethird operation, where the second preview image is a second image blockin a second region on a second image captured by the first wide-anglecamera, or the second preview image is an image block obtained afterangle of view conversion is performed on the second image block; and anorientation of the second region relative to the first region is relatedto the image movement direction.

For example, in a process in which a user performs video recording byusing a mobile phone, a preview image includes a scene A facing theuser, and does not include a scene B on the right front of the user. Theuser keeps a position of the mobile phone unchanged, and enters an imagerightward movement instruction (for example, by using a touchscreen). Inthis case, the preview image is updated to a new preview image includingthe scene B on the right front of the user (for example, excluding thescene A). Therefore, when the position of the electronic device remainsunchanged, a shooting manner such as “moving a lens” or “shaking a lens”may also be implemented, so that user experience is relatively good.

It should be understood that, that an orientation of the second regionrelative to the first region is related to the image movement directionincludes: the orientation of the second region relative to the firstregion is the same as or opposite to the image movement direction. Thisis not limited in this embodiment of this application. For example, theuser may voluntarily set the orientation of the second region relativeto the first region to be the same as or opposite to the image movementdirection.

In a possible design, that an orientation of the second region relativeto the first region is related to the image movement direction includes:a distance between the second region and a first edge of the secondimage is a second distance, a distance between the first region and afirst edge of the first image is a first distance, and a distance changeamount of the second distance relative to the first distance is relatedto the image movement direction.

For example, it is assumed that a distance between the first region anda left edge of the first image is H, and a distance between the secondregion and a left edge of the second image is H+A. When A is a positivenumber, it indicates that the orientation of the second region relativeto the first region is rightward; or when A is a negative number, itindicates that the orientation of the second region relative to thefirst region is leftward.

In an example, the electronic device determines a third region on athird image, where a second orientation change amount of the thirdregion relative to the second region is equal to a first orientationchange amount of the second region relative to the first region; anddisplays a third preview image on the viewfinder interface, where thethird preview image is a third image block in the third region on thethird image, or the third preview image is an image block obtained afterangle of view conversion is performed on the third image block. Thesecond orientation change amount is a distance change amount of a thirddistance relative to the second distance, and the first orientationchange amount is the distance change amount of the second distancerelative to the first distance. The third distance is a distance betweenthe third region and a first edge of the third image, the seconddistance is the distance between the second region and the first edge ofthe second image, and the first distance is the distance between thefirst region and the first edge of the first image.

In other words, change amounts of positions of preview images on imagescaptured by the first wide-angle camera are the same. Therefore,visually, a preview image on the viewfinder interface moves at aconstant speed, so that user experience is relatively good.

In another example, a second orientation change amount of the thirdregion relative to the second region may alternatively be greater than afirst orientation change amount of the second region relative to thefirst region. Therefore, visually, a preview image on the viewfinderinterface moves at an accelerated speed, so that a sense of rhythm andvisual impact are implemented.

Certainly, a second orientation change amount of the third regionrelative to the second region may alternatively be less than a firstorientation change amount of the second region relative to the firstregion. Therefore, visually, a preview image on the viewfinder interfacemoves at a decelerated speed, so that video recording flexibility andinterestingness are higher.

In a possible design, before entering the first video recording mode,the electronic device displays a fourth preview image on the viewfinderinterface, where the fourth preview image is an image captured by asecond wide-angle camera, a field of view of the second wide-anglecamera is less than a field of view of the first wide-angle camera, andthe first preview image is some or all of image blocks within anoverlapping range between the field of view of the first wide-anglecamera and the field of view of the second wide-angle camera. In otherwords, when switching from another mode to the first video recordingmode, the electronic device starts the first wide-angle camera with alarger field of view, and displays, on the viewfinder interface, thefirst image block in the first region on the first image captured by thefirst wide-angle camera. Larger coverage of an image captured by acamera with a larger field of view indicates that more details areincluded and a movable range of a position of a first region on an imageis larger. Therefore, a shooting manner such as “moving a lens” or“shaking a lens” may be implemented within a larger movable range, sothat user experience is relatively good.

It should be understood that a magnification of an image captured by thesecond wide-angle camera is less than or equal to a magnification of animage captured by the first wide-angle camera.

The third operation includes: a flick operation on the first previewimage; or

an operation on a control used to indicate an image rotation directionon the viewfinder interface; or

an operation of pressing and dragging a specific control on theviewfinder interface.

It should be understood that the foregoing third operation is merely anexample instead of a limitation. Another operation used to input animage movement direction is also feasible. This is not limited in thisembodiment of this application.

It can be understood that, when an image movement stop instruction isdetected, a fifth preview image is displayed on the viewfinderinterface, where the fifth preview image is a fifth image block in afifth region on a fifth image captured by the first wide-angle camera,or the fifth preview image is an image block obtained after angle ofview conversion is performed on the fifth image block; and anorientation of the fifth region relative to the second region does notchange. In other words, when an image movement stop instruction isdetected, an orientation of a preview image on an image does not change,and a position of the preview image on the viewfinder interface visuallydoes not change.

It can be understood that, when detecting an image movement stopinstruction, the electronic device generates and stores a video, wherethe video includes the second preview image. In other words, whendetecting an image movement stop instruction, the electronic deviceautomatically generates a video, and stores the video. This facilitatesan operation and improves user experience.

The detecting an image movement stop instruction includes:

when the third operation is a flick operation on the first previewimage, generating the image movement stop instruction when detecting anuplift after the flick operation; or

when the third operation is an operation of tapping a control used toindicate an image movement direction on the viewfinder interface,generating the image movement stop instruction when detecting that a tapoperation is performed again at any position on the viewfinderinterface; or

when the third operation is an operation of touching and holding acontrol used to indicate an image movement direction on the viewfinderinterface, generating the image movement stop instruction when detectingan uplift after the touch and hold operation; or

when the third operation is an operation of pressing and dragging aspecific control on the viewfinder interface, generating the imagemovement stop instruction when detecting an uplift after the dragoperation.

It should be noted that the image movement stop instruction is merely anexample instead of a limitation. Another image movement stop instructionis also feasible. This is not limited in this embodiment of thisapplication.

For example, the second image is one of M frames of images obtainedthrough frame extraction from N frames of images captured by the firstwide-angle camera, where N is an integer greater than or equal to 1, andM is an integer less than N. Frame extraction play can achieve a fastplay effect. Therefore, a preview image can be quickly played.Alternatively, the second image is one of M frames of images obtainedthrough multi-frame image insertion into N frames of images captured bythe first wide-angle camera, where N is an integer greater than or equalto 1, and M is an integer greater than N. Frame insertion play canachieve a slow play effect. Therefore, a preview image can be slowlyplayed.

The image block obtained after angle of view conversion is performed onthe second image block satisfies the following formulas:

x′=x*cos(θ)−sin(θ)*y; and

y′=x*sin(θ)+cos(θ)*y.

Herein, (x′, y′) is a pixel on the image block obtained after the angleof view conversion; (x, y) is a pixel on the second image block; and θis a rotation angle, and the rotation angle is preset. After theelectronic device performs angle of view conversion on an image block byusing the foregoing formulas, a preview image is more suitable for apreview image presented when the mobile phone is shaken actually.Therefore, when the position of the electronic device remains unchanged,the user may implement a shooting manner such as “moving a lens” or“shaking a lens” by using the electronic device, so that user experienceis relatively good.

According to a ninth aspect, a method for displaying a preview image ina video recording scenario is further provided. The method is applied toan electronic device. The electronic device detects a first operationused to open a camera application; starts the camera application inresponse to the first operation; detects a second operation used toindicate a first video recording mode; displays a viewfinder interfaceon a display of the electronic device in response to the secondoperation, where the viewfinder interface includes a first previewimage, and the first preview image is a first image captured by a cameraon the electronic device; keeps a position of the electronic deviceunchanged, and detects a third operation that indicates an imagerotation direction; and displays a second preview image on theviewfinder interface in response to the third operation, where thesecond preview image is an image obtained after a second image capturedby the camera rotates in the image rotation direction. In other words,in a process in which a user performs video recording by using anelectronic device, a preview image on a viewfinder interface may rotate,so that an image rotation shooting effect is achieved, and userexperience is relatively good.

In a possible design, a third preview image is displayed on theviewfinder interface, where the third preview image is an image obtainedafter a third image captured by the camera rotates in the image rotationdirection, and a rotation angle of the third image relative to thesecond image is the same as a rotation angle of the second imagerelative to the first image.

In other words, in a process in which a user performs video recording byusing an electronic device, a preview image on a viewfinder interfacerotates at a same angle each time, in other words, rotates at a constantspeed, so that a rotation shooting effect is achieved.

For example, the camera is a first wide-angle camera, the first image isa first image block in a first region on a fourth image captured by thefirst wide-angle camera, the second image is a second image block in asecond region on a fifth image captured by the first wide-angle camera,and a position of the first region on the fourth image is the same as ordifferent from a position of the second region on the fifth image.

The third operation includes: a circle drawing operation on the firstpreview image; or

an operation on a control used to indicate an image rotation directionon the viewfinder interface.

It should be understood that the foregoing third operation is merely anexample instead of a limitation. Another operation used to input animage movement direction is also feasible. This is not limited in thisembodiment of this application.

In a possible design, when detecting an image rotation stop instruction,the electronic device generates and stores a video, where the videoincludes the second preview image. In other words, when detecting animage rotation stop instruction, the electronic device automaticallygenerates a video, and stores the video. This facilitates an operationand improves user experience.

The detecting an image rotation stop instruction includes:

when the third operation is a circle drawing operation on the firstpreview image, generating the image rotation stop instruction whendetecting an uplift after the circle drawing operation; or

when the third operation is an operation of tapping a control used toindicate an image rotation direction on the viewfinder interface,generating the image rotation stop instruction when detecting that a tapoperation is performed again at any position on the viewfinderinterface; or

when the third operation is an operation of touching and holding acontrol used to indicate an image rotation direction on the viewfinderinterface, generating the image rotation stop instruction when detectingan uplift after the touch and hold operation.

It should be noted that the image rotation stop instruction is merely anexample instead of a limitation. Another image rotation stop instructionis also feasible. This is not limited in this embodiment of thisapplication.

The second image is one of M frames of images obtained through frameextraction from N frames of images captured by the first camera, where Nis an integer greater than or equal to 1, and M is an integer less thanN. Frame extraction play can achieve a fast play effect. Therefore, apreview image can be quickly played. Alternatively, the second image isone of M frames of images obtained through multi-frame image insertioninto N frames of images captured by the first camera, where N is aninteger greater than or equal to 1, and M is an integer greater than N.Frame insertion play can achieve a slow play effect. Therefore, apreview image can be slowly played.

According to a tenth aspect, an electronic device is further provided.The electronic device includes one or more processors and one or morememories. The one or more memories store one or more computer programs,the one or more computer programs include instructions, and when theinstructions are executed by the one or more processors, the electronicdevice is enabled to perform the following steps:

detecting a first operation used to open a camera application:

starting the camera application in response to the first operation;

detecting a second operation used to indicate a first video recordingmode:

displaying a viewfinder interface on a display of the electronic devicein response to the second operation, where the viewfinder interfaceincludes a first preview image, and the first preview image is a firstimage block in a first region on a first image captured by a firstwide-angle camera on the electronic device:

keeping a position of the electronic device unchanged, and detecting athird operation that indicates an image movement direction; and

displaying a second preview image on the viewfinder interface inresponse to the third operation, where the second preview image is asecond image block in a second region on a second image captured by thefirst wide-angle camera, or the second preview image is an image blockobtained after angle of view conversion is performed on the second imageblock; and an orientation of the second region relative to the firstregion is related to the image movement direction.

In a possible design, that an orientation of the second region relativeto the first region is related to the image movement direction includes:the orientation of the second region relative to the first region is thesame as or opposite to the image movement direction.

In a possible design, that an orientation of the second region relativeto the first region is related to the image movement direction includes:a distance between the second region and a first edge of the secondimage is a second distance, a distance between the first region and afirst edge of the first image is a first distance, and a distance changeamount of the second distance relative to the first distance is relatedto the image movement direction.

In a possible design, when the instructions are executed by the one ormore processors, the electronic device is enabled to perform thefollowing step:

displaying a third preview image on the viewfinder interface, where thethird preview image is a third image block in a third region on a thirdimage, or the third preview image is an image block obtained after angleof view conversion is performed on the third image block; and a secondorientation change amount of the third region relative to the secondregion is equal to a first orientation change amount of the secondregion relative to the first region.

The second orientation change amount is a distance change amount of athird distance relative to the second distance, and the firstorientation change amount is the distance change amount of the seconddistance relative to the first distance. The third distance is adistance between the third region and a first edge of the third image,the second distance is the distance between the second region and thefirst edge of the second image, and the first distance is the distancebetween the first region and the first edge of the first image.

In a possible design, when the instructions are executed by the one ormore processors, the electronic device is enabled to further perform thefollowing step: before the detecting a second operation used to indicatea first video recording mode, displaying a fourth preview image on theviewfinder interface, where the fourth preview image is an imagecaptured by a second wide-angle camera, a field of view of the secondwide-angle camera is less than a field of view of the first wide-anglecamera, and the first preview image is some or all of image blockswithin an overlapping range between the field of view of the firstwide-angle camera and the field of view of the second wide-angle camera.

A magnification of an image captured by the second wide-angle camera isless than or equal to a magnification of an image captured by the firstwide-angle camera.

The third operation includes:

a flick operation on the first preview image; or

an operation on a control used to indicate an image rotation directionon the viewfinder interface; or

an operation of pressing and dragging a specific control on theviewfinder interface.

In a possible design, when the instructions are executed by the one ormore processors, the electronic device is enabled to further perform thefollowing step: when detecting an image movement stop instruction,displaying a fifth preview image on the viewfinder interface, where thefifth preview image is a fifth image block in a fifth region on a fifthimage captured by the first wide-angle camera, or the fifth previewimage is an image block obtained after angle of view conversion isperformed on the fifth image block; and an orientation of the fifthregion relative to the second region does not change.

In a possible design, when the instructions are executed by the one ormore processors, the electronic device is enabled to further perform thefollowing steps: when detecting an image movement stop instruction,generating and storing a video, where the video includes the firstpreview image and the second preview image.

In a possible design, when the instructions are executed by the one ormore processors, the electronic device is enabled to specificallyperform the following step:

when the third operation is a flick operation on the first previewimage, generating the image movement stop instruction when detecting anuplift after the flick operation; or

when the third operation is an operation of tapping a control used toindicate an image movement direction on the viewfinder interface,generating the image movement stop instruction when detecting that a tapoperation is performed again at any position on the viewfinderinterface: or

when the third operation is an operation of touching and holding acontrol used to indicate an image movement direction on the viewfinderinterface, generating the image movement stop instruction when detectingan uplift after the touch and hold operation; or

when the third operation is an operation of pressing and dragging aspecific control on the viewfinder interface, generating the imagemovement stop instruction when detecting an uplift after the dragoperation.

The second image is one of M frames of images obtained through frameextraction from N frames of images captured by the first wide-anglecamera, where N is an integer greater than or equal to 1, and M is aninteger less than N; or the second image is one of M frames of imagesobtained through multi-frame image insertion into N frames of imagescaptured by the first wide-angle camera, where N is an integer greaterthan or equal to 1, and M is an integer greater than N.

In a possible design, the image block obtained after angle of viewconversion is performed on the second image block satisfies thefollowing formulas:

x′=x*cos(θ)−sin(θ)*y; and

y′=x*sin(θ)+cos(θ)*y.

Herein, (x′, y′) is a pixel on the image block obtained after the angleof view conversion: (x, y) is a pixel on the second image block; and θis a rotation angle, and the rotation angle is preset.

According to an eleventh aspect, an electronic device is furtherprovided. The electronic device includes one or more processors and oneor more memories. The one or more memories store one or more computerprograms, the one or more computer programs include instructions, andwhen the instructions are executed by the one or more processors, theelectronic device is enabled to perform the following steps:

detecting a first operation used to open a camera application, startingthe camera application in response to the first operation; detecting asecond operation used to indicate a first video recording mode;displaying a viewfinder interface on a display of the electronic devicein response to the second operation, where the viewfinder interfaceincludes a first preview image, and the first preview image is a firstimage captured by a camera on the electronic device; keeping a positionof the electronic device unchanged, and detecting a third operation thatindicates an image rotation direction; and displaying a second previewimage on the viewfinder interface in response to the third operation,where the second preview image is an image obtained after a second imagecaptured by the camera rotates in the image rotation direction.

In a possible design, when the instructions are executed by the one ormore processors, the electronic device is enabled to further perform thefollowing step:

displaying a third preview image on the viewfinder interface, where thethird preview image is an image obtained after a third image captured bythe camera rotates in the image rotation direction, and a rotation angleof the third image relative to the second image is the same as arotation angle of the second image relative to the first image.

The camera is a first wide-angle camera, the first image is a firstimage block in a first region on a fourth image captured by the firstwide-angle camera, the second image is a second image block in a secondregion on a fifth image captured by the first wide-angle camera, and aposition of the first region on the fourth image is the same as ordifferent from a position of the second region on the fifth image.

The third operation includes:

a circle drawing operation on the first preview image; or

an operation on a control used to indicate an image rotation directionon the viewfinder interface.

In a possible design, when the instructions are executed by the one ormore processors, the electronic device is enabled to further perform thefollowing steps: when detecting an image rotation stop instruction,generating and storing a video, where the video includes the firstpreview image and the second preview image.

In a possible design, when the instructions are executed by the one ormore processors, the electronic device is enabled to specificallyperform the following step:

when the third operation is a circle drawing operation on the firstpreview image, generating the image rotation stop instruction whendetecting an uplift after the circle drawing operation; or

when the third operation is an operation of tapping a control used toindicate an image rotation direction on the viewfinder interface,generating the image rotation stop instruction when detecting that a tapoperation is performed again at any position on the viewfinderinterface; or

when the third operation is an operation of touching and holding acontrol used to indicate an image rotation direction on the viewfinderinterface, generating the image rotation stop instruction when detectingan uplift after the touch and hold operation.

The second image is one of M frames of images obtained through frameextraction from N frames of images captured by the first camera, where Nis an integer greater than or equal to 1, and M is an integer less thanN; or the second image is one of M frames of images obtained throughmulti-frame image insertion into N frames of images captured by thefirst camera, where N is an integer greater than or equal to 1, and M isan integer greater than N.

According to a twelfth aspect, an electronic device is further provided.The electronic device includes modules/units that perform the methodaccording to any one of the eighth aspect and the possible designs ofthe eighth aspect. These modules/units may be implemented by hardware,or may be implemented by hardware by executing corresponding software.

According to a thirteenth aspect, an electronic device is furtherprovided. The electronic device includes modules/units that perform themethod according to any one of the ninth aspect and the possible designsof the ninth aspect. These modules/units may be implemented by hardware,or may be implemented by hardware by executing corresponding software.

According to a fourteenth aspect, a chip is further provided. The chipis coupled to a memory in an electronic device, and is configured toperform the technical solution according to any one of the eighth aspectand the possible designs of the eighth aspect in the embodiments of thisapplication. In this embodiment of this application, “coupling” meansthat two components are directly or indirectly combined with each other.

According to a fifteenth aspect, a chip is further provided. The chip iscoupled to a memory in an electronic device, and is configured toperform the technical solution according to any one of the ninth aspectand the possible designs of the ninth aspect in the embodiments of thisapplication. In this embodiment of this application, “coupling” meansthat two components are directly or indirectly combined with each other.

According to a sixteenth aspect, a computer-readable storage medium isfurther provided. The computer-readable storage medium includes acomputer program, and when the computer program is run on an electronicdevice, the electronic device is enabled to perform the technicalsolution according to any one of the eighth aspect and the possibledesigns of the eighth aspect.

According to a seventeenth aspect, a computer-readable storage medium isfurther provided. The computer-readable storage medium includes acomputer program, and when the computer program is run on an electronicdevice, the electronic device is enabled to perform the technicalsolution according to any one of the ninth aspect and the possibledesigns of the ninth aspect.

According to an eighteenth aspect, a program product is furtherprovided. The program product includes instructions, and when theinstructions are run on a computer, the computer is enabled to performthe technical solution according to any one of the eighth aspect and thepossible designs of the eighth aspect.

According to a nineteenth aspect, a program product is further provided.The program product includes instructions, and when the instructions arerun on a computer, the computer is enabled to perform the technicalsolution according to any one of the ninth aspect and the possibledesigns of the ninth aspect.

According to a twentieth aspect, a graphical user interface on anelectronic device is further provided. The electronic device includesone or more memories and one or more processors. The one or moreprocessors are configured to execute one or more computer programsstored in the one or more memories. The graphical user interfaceincludes a graphical user interface displayed when the electronic deviceperforms the technical solution according to any one of the eighthaspect and the possible designs of the eighth aspect.

According to a twenty-first aspect, a graphical user interface on anelectronic device is further provided. The electronic device includesone or more memories and one or more processors. The one or moreprocessors are configured to execute one or more computer programsstored in the one or more memories. The graphical user interfaceincludes a graphical user interface displayed when the electronic deviceperforms the technical solution according to any one of the ninth aspectand the possible designs of the ninth aspect.

For beneficial effects of the ninth aspect to the twenty-first aspect,refer to the beneficial effects of the eighth aspect. Details are notdescribed again.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1(a) to FIG. 1(c) are a schematic diagram of implementing “shakinga lens” and “moving a lens” by using a mobile phone in the conventionaltechnology;

FIG. 2A is a schematic diagram of a hardware structure of an electronicdevice according to an embodiment of this application;

FIG. 2B is a schematic diagram of a software structure of an electronicdevice according to an embodiment of this application;

FIG. 3A-(a) to FIG. 3A-(c) are schematic diagrams of implementationprinciples of various camera movement modes according to an embodimentof this application;

FIG. 3B-(a) to FIG. 3B-(c) are a schematic diagram of an example of amove mode according to an embodiment of this application;

FIG. 4(a) and FIG. 4(b) are a schematic diagram of an example of a GUIof a mobile phone according to an embodiment of this application;

FIG. 5A-(a) to FIG. 5A-(c) and FIG. 5B are schematic diagrams of a micromovie icon on a mobile phone according to an embodiment of thisapplication:

FIG. 6(a) and FIG. 6(b) are a schematic diagram of a home page of amicro movie mode according to an embodiment of this application;

FIG. 7A, FIG. 7B-(a) to FIG. 7B-(c), FIG. 7C-(a) to FIG. 7C-(c), andFIG. 7D-(a) to FIG. 7D-(c) are schematic diagrams of an example of arecording interface of a travel template according to an embodiment ofthis application;

FIG. 8A-(a), FIG. 8A-(b), FIG. 8B-(a) to FIG. 8B-(c), FIG. 8C, FIG.8D-(a), and FIG. 8D-(b) are schematic diagrams of another example of arecording interface of a travel template according to an embodiment ofthis application;

FIG. 9A-(a), FIG. 9A-(b), FIG. 9B-(a), FIG. 9B-(b), FIG. 9C-(a) to FIG.9C-(c), FIG. 9D-(a) to FIG. 9D-(c), FIG. 9E-(a) to FIG. 9E-(d), and FIG.9F-(a) to FIG. 9F-(c) are schematic diagrams of an effect presentationinterface according to an embodiment of this application;

FIG. 10 is a schematic diagram of an interface of “Gallery” according toan embodiment of this application;

FIG. 11A-(a) to FIG. 11A-(c) and FIG. 11B are schematic diagrams ofanother example of a home page of a micro movie mode according to anembodiment of this application;

FIG. 11C is a schematic diagram of an interface for selecting cameramovement modes and combining the camera movement modes into a shootingtemplate according to an embodiment of this application:

FIG. 12 is a schematic flowchart of a video shooting method according toan embodiment of this application;

FIG. 13(a), FIG. 13(b), FIG. 14(a), FIG. 14(b), FIG. 15(a), FIG. 15(b),FIG. 16 , and FIG. 17 are schematic diagrams of a graphical userinterface of an electronic device according to an embodiment of thisapplication;

FIG. 18 is a schematic diagram of moving a target region on an imagecaptured by an ultra-wide-angle camera according to an embodiment ofthis application;

FIG. 19A to FIG. 19D are schematic diagrams of moving a target region onan image captured by an ultra-wide-angle camera according to anembodiment of this application;

FIG. 20(a) to FIG. 20(c) and FIG. 21 to FIG. 24 are schematic diagramsof a graphical user interface of an electronic device according to anembodiment of this application;

FIG. 25 is a schematic diagram of rotating a target region on an imagecaptured by an ultra-wide-angle camera according to an embodiment ofthis application:

FIG. 26 and FIG. 27 are schematic diagrams of a graphical user interfaceof an electronic device according to an embodiment of this application:

FIG. 28 is a schematic diagram of magnifying a target region on an imagecaptured by an ultra-wide-angle camera according to an embodiment ofthis application;

FIG. 29 is a schematic diagram of a graphical user interface of anelectronic device according to an embodiment of this application; and

FIG. 30 and FIG. 31 are schematic flowcharts of a method for displayinga preview image in a video recording scenario according to embodimentsof this application.

DESCRIPTION OF EMBODIMENTS

The following describes some terms in the embodiments of thisapplication to help a person skilled in the art have a betterunderstanding.

A preview image in the embodiments of this application is an imagedisplayed on a viewfinder interface of an electronic device. Forexample, when the electronic device is a mobile phone, the mobile phonestarts a camera application, opens a camera, and displays a viewfinderinterface, where a preview image is displayed on the viewfinderinterface. The mobile phone is still used as an example. When the mobilephone enables a video call function (for example, a video communicationfunction in WeChat), the mobile phone opens a camera, and displays aviewfinder interface, where a preview image is displayed on theviewfinder interface.

A field of view in the embodiments of this application is an importantperformance parameter of a camera. In addition, “field of view” may alsobe referred to as terms such as “angle of view”, “vision scope”, and“vision field scope”. This specification imposes no limitation on thename. The field of view is used to indicate a maximum shooting anglerange of the camera. If an object is in the angle range, the object iscaptured by the camera and therefore is further presented in a previewimage. If an object is outside the angle range, the object is notcaptured by the camera and therefore is not presented in a previewimage.

Generally, a larger field of view of the camera indicates a largershooting range and a shorter focal length; and a smaller field of viewof the camera indicates a smaller shooting range and a longer focallength. Therefore, cameras may be classified into a common camera, awide-angle camera, an ultra-wide-angle camera, and the like due todifferent fields of view. For example, a focal length of the commoncamera may range from 40 millimeters to 45 millimeters, and an angle ofview may range from 40 degrees to 60 degrees; a focal length of thewide-angle camera may range from 24 millimeters to 38 millimeters, andan angle of view may range from 60 degrees to 84 degrees; and a focallength of the ultra-wide-angle camera may range from 13 millimeters to20 millimeters, and an angle of view may range from 94 degrees to 118degrees.

A video shooting method provided in the embodiments of this applicationmay be applied to an electronic device. The electronic device includes acamera. Preferably, the camera is a wide-angle camera or anultra-wide-angle camera. Certainly, the camera may alternatively be acommon camera. A quantity of cameras is not limited in this application.There may be one or more cameras. If there are a plurality of cameras,the plurality of cameras may preferably include at least one wide-anglecamera or at least one ultra-wide-angle camera.

The electronic device may be, for example, a mobile phone, a tabletcomputer, a wearable device (for example, a watch, a wristband, ahelmet, a headset, or a necklace), a vehicle-mounted device, anaugmented reality (augmented reality, AR) device/a virtual reality(virtual reality, VR) device, a notebook computer, an ultra-mobilepersonal computer (ultra-mobile personal computer, UMPC), a netbook, ora personal digital assistant (personal digital assistant. PDA). Aspecific type of the electronic device is not limited in the embodimentsof this application.

For example, FIG. 2A is a schematic structural diagram of an electronicdevice 100. As shown in FIG. 2A, the electronic device 100 may include aprocessor 110, an external memory interface 120, an internal memory 121,a universal serial bus (universal serial bus, USB) port 130, a chargingmanagement module 140, a power management module 141, a battery 142, anantenna 1, an antenna 2, a mobile communications module 150, a wirelesscommunications module 160, an audio module 170, a speaker 170A, areceiver 170B, a microphone 170C, a headset jack 170D, a sensor module180, a button 190, a motor 191, an indicator 192, a camera 193, adisplay 194, a subscriber identity module (subscriber identificationmodule, SIM) card interface 195, and the like.

The processor 110 may include one or more processing units. For example,the processor 110 may include an application processor (applicationprocessor. AP), a modem processor, a graphics processing unit (graphicsprocessing unit, GPU), an image signal processor (image signalprocessor, ISP), a controller, a memory, a video codec, a digital signalprocessor (digital signal processor, DSP), a baseband processor, and/ora neural network processing unit (neural-network processing unit, NPU).Different processing units may be independent devices, or may beintegrated into one or more processors. The controller may be a nervecenter and a command center of the electronic device 100. The controllermay generate an operation control signal based on an instructionoperation code and a time sequence signal, to complete control ofinstruction fetching and instruction execution. A memory may be furtherdisposed in the processor 110, and is configured to store instructionsand data. In some embodiments, the memory in the processor 110 is acache memory. The memory may store instructions or data just used orcyclically used by the processor 110. If the processor 110 needs to usethe instructions or the data again, the processor 110 may directlyinvoke the instructions or the data from the memory. This avoidsrepeated access and reduces a waiting time of the processor 110, therebyimproving system efficiency.

The USB port 130 is an interface that conforms to a USB standardspecification, and may be specifically a mini USB port, a micro USBport, a USB Type C port, or the like. The USB port 130 may be configuredto connect to a charger to charge the electronic device 100, and mayalso be configured to transmit data between the electronic device 100and a peripheral device. The charging management module 140 isconfigured to receive a charging input from the charger. The powermanagement module 141 is configured to connect to the battery 142, thecharging management module 140, and the processor 110. The powermanagement module 141 receives an input of the battery 142 and/or thecharging management module 140, and supplies power to the processor 110,the internal memory 121, an external memory, the display 194, the camera193, the wireless communications module 160, and the like.

A wireless communication function of the electronic device 100 may beimplemented through the antenna 1, the antenna 2, the mobilecommunications module 150, the wireless communications module 160, themodem processor, the baseband processor, and the like. The antenna 1 andthe antenna 2 are configured to transmit and receive electromagneticwave signals. Each antenna in the electronic device 100 may beconfigured to cover one or more communication bands. Different antennasmay be further multiplexed, to increase antenna utilization. Forexample, the antenna 1 may be multiplexed as a diversity antenna in awireless local area network. In some other embodiments, the antenna maybe used in combination with a tuning switch.

The mobile communications module 150 may provide a solution, applied tothe electronic device 100, to wireless communication including 2G, 3G,4G, 5G, or the like. The mobile communications module 150 may include atleast one filter, a switch, a power amplifier, a low noise amplifier(low noise amplifier, LNA), and the like. The mobile communicationsmodule 150 may receive an electromagnetic wave through the antenna 1,perform processing such as filtering or amplification on the receivedelectromagnetic wave, and transmit a processed electromagnetic wave tothe modem processor for demodulation. The mobile communications module150 may further amplify a signal modulated by the modem processor, andconvert an amplified signal into an electromagnetic wave through theantenna 1 for radiation. In some embodiments, at least some functionmodules in the mobile communications module 150 may be disposed in theprocessor 110. In some embodiments, at least some functional modules inthe mobile communications module 150 may be disposed in a same device asat least some modules in the processor 110.

The wireless communications module 160 may provide a solution, appliedto the electronic device 100, to wireless communication including awireless local area network (wireless local area networks, WLAN) (forexample, a wireless fidelity (wireless fidelity, Wi-Fi) network),Bluetooth (bluetooth. BT), a global navigation satellite system (globalnavigation satellite system, GNSS), frequency modulation (frequencymodulation, FM), a near field communication (near field communication,NFC) technology, an infrared (infrared, IR) technology, or the like. Thewireless communications module 160 may be one or more componentsintegrated into at least one communications processing module. Thewireless communications module 160 receives an electromagnetic wavethrough the antenna 2, performs frequency modulation and filteringprocessing on the electromagnetic wave signal, and sends a processedsignal to the processor 110. The wireless communications module 160 mayfurther receive a to-be-sent signal from the processor 110, performfrequency modulation and amplification on the signal, and convert aprocessed signal into an electromagnetic wave through the antenna 2 forradiation.

In some embodiments, in the electronic device 100, the antenna 1 and themobile communications module 150 are coupled, and the antenna 2 and thewireless communications module 160 are coupled, so that the electronicdevice 100 can communicate with a network and another device by using awireless communications technology. The wireless communicationstechnology may include a global system for mobile communications (globalsystem for mobile communications, GSM), a general packet radio service(general packet radio service. GPRS), code division multiple access(code division multiple access, CDMA), wideband code division multipleaccess (wideband code division multiple access, WCDMA), timedivision-synchronous code division multiple access (time-division codedivision multiple access, TD-SCDMA), long term evolution (long termevolution, LTE), BT, a GNSS, a WLAN, NFC, FM, an IR technology, and/orthe like. The GNSS may include a global positioning system (globalpositioning system. GPS), a global navigation satellite system (globalnavigation satellite system, GLONASS), a BeiDou navigation satellitesystem (beidou navigation satellite system, BDS), a quasi-zenithsatellite system (quasi-zenith satellite system, QZSS), and/or asatellite based augmentation system (satellite based augmentationsystems, SBAS).

The display 194 is configured to display a display interface of anapplication, for example, a viewfinder interface of a cameraapplication. The display 194 includes a display panel. The display panelmay be a liquid crystal display (liquid crystal display, LCD), anorganic light-emitting diode (organic light-emitting diode, OLED), anactive-matrix organic light emitting diode (active-matrix organic lightemitting diode, AMOLED), a flexible light-emitting diode (flexlight-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, a quantumdot light emitting diode (quantum dot light emitting diodes, QLED), orthe like. In some embodiments, the electronic device 100 may include oneor N displays 194, where N is a positive integer greater than 1.

The electronic device 100 may implement a shooting function through theISP, the camera 193, the video codec, the GPU, the display 194, theapplication processor, and the like.

The ISP is configured to process data fed back by the camera 193. Forexample, during shooting, a shutter is pressed, light is transmitted toa photosensitive element of the camera through a lens, an optical signalis converted into an electrical signal, and the photosensitive elementof the camera transmits the electrical signal to the ISP for processing,to convert the electrical signal into a visible image. The ISP mayfurther perform algorithm optimization on noise, brightness, andcomplexion of the image. The ISP may further optimize parameters such asexposure and a color temperature of a shooting scenario. In someembodiments, the ISP may be disposed in the camera 193.

The camera 193 is configured to capture a static image or a video. Anoptical image of an object is generated through the lens, and isprojected onto the photosensitive element. The photosensitive elementmay be a charge coupled device (charge coupled device, CCD) or acomplementary metal-oxide-semiconductor (complementarymetal-oxide-semiconductor, CMOS) phototransistor. The photosensitiveelement converts an optical signal into an electrical signal, and thentransmits the electrical signal to the ISP for converting the electricalsignal into a digital image signal. The ISP outputs the digital imagesignal to the DSP for processing. The DSP converts the digital imagesignal into an image signal in a standard format such as an RGB formator a YUV format. In some embodiments, the electronic device 100 mayinclude one or N cameras 193, where N is a positive integer greater than1.

The digital signal processor is configured to process a digital signal,and may process another digital signal in addition to the digital imagesignal. For example, when the electronic device 100 selects a frequency,the digital signal processor is configured to perform Fourier transformon frequency energy.

The video codec is configured to compress or decompress a digital video.The electronic device 100 may support one or more video codecs.Therefore, the electronic device 100 may play or record videos in aplurality of coding formats, for example, moving picture experts group(moving picture experts group. MPEG)1, MPEG2, MPEG3, and MPEG4.

The NPU is a neural network (neural-network, NN) computing processor,quickly processes input information by referring to a structure of abiological neural network, for example, by referring to a mode oftransmission between human brain neurons, and may further continuouslyperform self-learning. The NPU can implement applications such asintelligent cognition of the electronic device 100, such as imagerecognition, facial recognition, speech recognition, and textunderstanding.

The internal memory 121 may be configured to store computer-executableprogram code. The executable program code includes instructions. Theprocessor 110 runs the instructions stored in the internal memory 121,to perform various function applications of the electronic device 100and data processing. The internal memory 121 may include a programstorage area and a data storage area. The program storage area may storean operating system, software code of at least one application (such asan iQIYI application or a WeChat application), and the like. The datastorage area may store data (for example, a shot image or a recordedvideo) or the like generated when the electronic device 100 is used. Inaddition, the internal memory 121 may include a high-speed random accessmemory, or may include a nonvolatile memory, for example, at least onemagnetic disk storage device, a flash memory, or a universal flashstorage (universal flash storage, UFS).

The external memory interface 120 may be configured to connect to anexternal memory card, for example, a micro SD card, to extend a storagecapability of the electronic device. The external memory cardcommunicates with the processor 110 through the external memoryinterface 120, to implement a data storage function. For example, filessuch as music and a video are stored in the external memory card.

The electronic device 100 may implement audio functions such as musicplaying and recording functions through the audio module 170, thespeaker 170A, the receiver 170B, the microphone 170C, the headset jack170D, the application processor, and the like.

The sensor module 180 may include a pressure sensor 180A, a gyroscopesensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D,an acceleration sensor 180E, a range sensor 180F, an optical proximitysensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, atouch sensor 180K, an ambient light sensor 180L, a bone conductionsensor 180M, and the like.

The pressure sensor 180A is configured to sense a pressure signal, andmay convert the pressure signal into an electrical signal. In someembodiments, the pressure sensor 180A may be disposed on the display194. The gyroscope sensor 180B may be configured to determine a motionposture of the electronic device 100. In some embodiments, an angularvelocity of the electronic device 100 around three axes (namely, axes x,y, and z) may be determined through the gyroscope sensor 180B.

The gyroscope sensor 180B may be configured to implement imagestabilization during shooting. The barometric pressure sensor 180C isconfigured to measure barometric pressure. In some embodiments, theelectronic device 100 calculates an altitude based on a barometricpressure value measured by the barometric pressure sensor 180C, toassist in positioning and navigation. The magnetic sensor 180D includesa Hall sensor. The electronic device 100 may detect opening and closingof a flip cover by using the magnetic sensor 180D. In some embodiments,when the electronic device 100 is a clamshell phone, the electronicdevice 100 may detect opening and closing of a clamshell by using themagnetic sensor 180D. Further, a feature such as automatic unlockingupon opening of the clamshell is set based on a detected opening orclosing state of the flip cover or a detected opening or closing stateof the clamshell. The acceleration sensor 180E may detect accelerationsin various directions (usually on three axes) of the electronic device100, and may detect a magnitude and a direction of gravity when theelectronic device 100 is still. The acceleration sensor 180E may befurther configured to identify a posture of the electronic device 100,and is applied to applications such as a pedometer and switching betweena landscape mode and a portrait mode.

The range sensor 180F is configured to measure a distance. Theelectronic device 100 may measure a distance in an infrared manner or alaser manner. In some embodiments, in a shooting scenario, theelectronic device 100 may measure a distance through the range sensor180F, to implement quick focusing. The optical proximity sensor 180G mayinclude, for example, a light-emitting diode (LED) and an opticaldetector such as a photodiode. The light-emitting diode may be aninfrared light-emitting diode. The electronic device 100 emits infraredlight by using the light-emitting diode. The electronic device 100detects infrared reflected light from a nearby object by using thephotodiode. When detecting sufficient reflected light, the electronicdevice 100 may determine that there is an object near the electronicdevice 100. When detecting insufficient reflected light, the electronicdevice 100 may determine that there is no object near the electronicdevice 100. The electronic device 100 may detect, by using the opticalproximity sensor 180G, that a user holds the electronic device 100 closeto an ear for a call, to automatically perform screen-off for powersaving. The optical proximity sensor 180G may also be used in a smartcover mode or a pocket mode to automatically perform screen unlocking orlocking.

The ambient light sensor 180L is configured to sense ambient lightbrightness. The electronic device 100 may adaptively adjust brightnessof the display 194 based on the sensed ambient light brightness. Theambient light sensor 180L may also be configured to automatically adjusta white balance during shooting. The ambient light sensor 180L may alsocooperate with the optical proximity sensor 180G to detect whether theelectronic device 100 is in a pocket, to avoid an accidental touch. Thefingerprint sensor 180H is configured to collect a fingerprint. Theelectronic device 100 may use a feature of the collected fingerprint toimplement fingerprint-based unlocking, application lock access,fingerprint-based shooting, fingerprint-based call answering, and thelike.

The temperature sensor 180J is configured to detect a temperature. Insome embodiments, the electronic device 100 executes a temperatureprocessing policy by using the temperature detected by the temperaturesensor 180J. For example, when the temperature reported by thetemperature sensor 180J exceeds a threshold, the electronic device 100lowers performance of a processor located near the temperature sensor1803, to reduce power consumption to implement thermal protection. Insome other embodiments, when the temperature is less than anotherthreshold, the electronic device 100 heats the battery 142 to preventthe electronic device 100 from being abnormally powered off because of alow temperature. In some other embodiments, when the temperature is lessthan still another threshold, the electronic device 100 boosts an outputvoltage of the battery 142, to prevent abnormal power-off caused by alow temperature.

The touch sensor 180K is also referred to as a “touch panel”. The touchsensor 180K may be disposed on the display 194, and the touch sensor180K and the display 194 constitute a touchscreen, which is alsoreferred to as a “touch screen”. The touch sensor 180K is configured todetect a touch operation performed on or near the touch sensor 180K. Thetouch sensor may transfer a detected touch operation to the applicationprocessor, to determine a type of a touch event. The display 194 mayprovide a visual output related to the touch operation. In some otherembodiments, the touch sensor 180K may alternatively be disposed on asurface of the electronic device 100 at a position different from thatof the display 194.

The bone conduction sensor 180M may obtain a vibration signal. In someembodiments, the bone conduction sensor 180M may obtain a vibrationsignal of a vibration bone of a human vocal-cord part. The boneconduction sensor 180M may also be in contact with a human pulse, toreceive a blood pressure beating signal.

The button 190 includes a power button, a volume button, and the like.The button 190 may be a mechanical button, or may be a touch button. Theelectronic device 100 may receive a button input, and generate a buttonsignal input related to a user setting and function control of theelectronic device 100. The motor 191 may generate a vibration prompt.The motor 191 may be configured to provide an incoming call vibrationprompt or a touch vibration feedback. For example, touch operationsperformed on different applications (for example, shooting and audioplaying) may correspond to different vibration feedback effects. A touchvibration feedback effect may be further customized. The indicator 192may be an indicator light, and may be configured to indicate a chargingstatus and a power change, or may be configured to indicate a message, amissed call, a notification, and the like. The SIM card interface 195 isconfigured to connect to a SIM card. The SIM card may be inserted intothe SIM card interface 195 or removed from the SIM card interface 195,to implement contact with or separation from the electronic device 100.

It can be understood that the components shown in FIG. 2A do notconstitute a specific limitation on the electronic device 100. Themobile phone may further include more or fewer components than thoseshown in the figure, or combine some components, or split somecomponents, or have different component arrangements. In addition, acombination/connection relationship between the components in FIG. 2Amay also be adjusted and modified.

In this embodiment of this application, the electronic device 100 mayinclude one or more cameras 193. It is assumed that the electronicdevice 100 includes a plurality of cameras such as a camera 1 and acamera 2, and a field of view of the camera 1 is less than a field ofview of the camera 2. For example, the camera 1 is a long-focus camera,and the camera 2 is a wide-angle camera (which may be a commonwide-angle camera or an ultra-wide-angle camera); or the camera 1 is acommon wide-angle camera, and the camera 2 is an ultra-wide-anglecamera; or there are other different combinations. In some embodiments,both the camera 1 and the camera 2 may be rear-facing cameras orfront-facing cameras. It should be understood that the electronic device100 may further include more cameras, for example, a long-focus camera.

The electronic device 100 may provide a plurality of recording modes,for example, a common recording mode, a move mode, and a shake mode. Inthe common video recording mode, the electronic device 100 starts thecamera 1 with a relatively small field of view, and displays, on theviewfinder interface, an image captured by the camera 1. When switchingfrom the common video recording mode to the move mode, the electronicdevice 100 starts the camera 2 with a relatively large field of view,and displays, on the viewfinder interface, an image block on one frameof image captured by the camera 2. When the electronic device 100remains stationary, if the processor 110 (for example, a GPU or an NPU)responds to an image movement direction that is entered by the user (forexample, an image movement direction that is entered by performing aflick operation on a screen), according to the image movement direction,another image block on a next frame of image captured by the camera 2 isdetermined, and then the another image block is displayed on theviewfinder interface. An orientation of the another image block relativeto the previous image block is related to the image movement directionthat is entered by the user. In other words, the user enters the imagemovement direction to implement a shooting manner of “moving a lens”.Therefore, in this embodiment of this application, in a video recordingprocess of the mobile phone, the shooting manner of “moving a lens” mayalso be implemented without a need of moving a position of the mobilephone by the user, thereby facilitating an operation. Therefore, userexperience is relatively good.

FIG. 2B is a block diagram of a software structure of an electronicdevice according to an embodiment of this application. As shown in FIG.2B, the software structure of the electronic device may be a layeredarchitecture. For example, software may be divided into several layers,and each layer has a clear role and responsibility. The layerscommunicate with each other through a software interface. In someembodiments, an Android system is divided into four layers; anapplication layer, an application framework layer (framework, FWK), anAndroid runtime (Android runtime) and system library, and a kernel layerfrom top to bottom.

The application layer may include a series of application packages. Asshown in FIG. 2B, the application layer may include Camera. Settings, askin module, a user interface (user interface, UI), a third-partyapplication, and the like. The third-party application may includeWeChat, QQ, Gallery, Calendar, Phone, Map, Navigation, WLAN, Bluetooth,Music, Videos, Messages, and the like.

The application framework layer provides an application programminginterface (application programming interface, API) and a programmingframework for an application at the application layer. The applicationframework layer may include some predefined functions. As shown in FIG.2B, the application framework layer may include a window manager, acontent provider, a view system, a phone manager, a resource manager, anotification manager, and the like.

The window manager is configured to manage a window program. The windowmanager may obtain a size of a display, determine whether there is astatus bar, perform screen locking, take a screenshot, and the like. Thecontent provider is configured to: store and obtain data, and enable thedata to be accessed by an application. The data may include a video, animage, audio, calls that are made and received, a browsing history and abookmark, an address book, and the like.

The view system includes visual controls such as a control fordisplaying a text and a control for displaying a picture. The viewsystem may be configured to construct an application. A displayinterface may include one or more views. For example, a displayinterface including a notification icon of Messages may include a textdisplay view and a picture display view.

The phone manager is configured to provide a communication function ofthe electronic device, for example, management of a call status(including answering or declining).

The resource manager provides various resources for an application, forexample, a localized character string, an icon, a picture, a layoutfile, and a video file.

The notification manager enables an application to display notificationinformation in a status bar, and may be configured to convey anotification message. The notification manager may automaticallydisappear after a short pause without requiring user interaction. Forexample, the notification manager is configured to: notify downloadcompletion, provide a message notification, and the like. Thenotification manager may alternatively be a notification that appears ina top status bar of the system in a form of a graph or a scroll bartext, for example, a notification of an application running on thebackground or a notification that appears on the screen in a form of adialog window. For example, text information is prompted in the statusbar, a prompt tone is produced, the electronic device vibrates, or anindicator light blinks.

The Android runtime includes a kernel library and a virtual machine. TheAndroid runtime is responsible for scheduling and management of theAndroid system.

The core library includes two parts, a function that needs to be invokedin Java language and a core library of Android. The application layerand the application framework layer run on the virtual machine. Thevirtual machine executes Java files at the application layer and theapplication framework layer as binary files. The virtual machine isconfigured to implement functions such as object lifecycle management,stack management, thread management, security and exception management,and garbage collection.

The system library may include a plurality of function modules, forexample, a surface manager (surface manager), a media library (medialibraries), a three-dimensional graphics processing library (forexample, OpenGL ES), and a 2D graphics engine (for example, SGL).

The surface manager is configured to manage a display subsystem andprovide fusion of 2D and 3D layers for a plurality of applications.

The media library supports playback and recording in a plurality ofcommonly used audio and video formats, static image files, and the like.The media library may support a plurality of audio and video codingformats such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.

The three-dimensional graphics processing library is configured toimplement three-dimensional graphics drawing, image rendering,composition, layer processing, and the like.

The 2D graphics engine is a drawing engine for 2D drawing.

In addition, the system library may further include a graphicsprocessing library for image processing, to achieve “shaking”, “moving”,“ascending”, and “descending” shooting effects.

The kernel layer is a layer between hardware and software. The kernellayer includes at least a display driver, a camera driver, an audiodriver, and a sensor driver.

The hardware layer may include various types of sensors, for example,the acceleration sensor, the gyroscope sensor, and the touch sensor inthe embodiments of this application.

With reference to a method for displaying a preview image in a videorecording scenario in the embodiments of this application, the followingdescribes working procedures of software and hardware of the electronicdevice by using an example.

When the touch sensor 180K receives a touch operation, a correspondinghardware interruption is sent to the kernel layer. An example in whichthe touch operation is a touch tap operation is used. Assuming that acontrol corresponding to the tap operation is a control corresponding toan icon of the camera application, the camera application is started.Assuming that the camera application is currently in the move mode, thecamera driver at the kernel layer is invoked to drive a camera with arelatively large field of view (for example, an ultra-w % ide-anglecamera) to capture an image. The ultra-wide-angle camera sends thecaptured image to the graphics processing library in the system library.

The graphics processing library processes the image captured by theultra-wide-angle camera, for example, determines an image block on theimage. The display displays the image block, that is, a preview image,on the viewfinder interface of the camera application. When theelectronic device remains stationary, assuming that the touch sensor180K receives a flick operation, a corresponding hardware interruptionis sent to the kernel layer. The kernel layer processes the flickoperation into an original input event, and stores the original inputevent at the kernel layer. Assuming that the camera application obtainsthe original input event from the kernel layer and identifies that theinput event corresponds to a flick direction, the graphics processinglibrary determines another image block on the image captured by theultra-wide-angle camera, where an orientation of the another image blockrelative to the one image block is related to the flick direction.Therefore, in a video recording process of the electronic device, aneffect of “moving a lens” may also be achieved when the electronicdevice remains stationary.

For ease of understanding, in the following embodiments of thisapplication, an example in which the electronic device is a mobile phoneis used to describe in detail the video shooting method provided in theembodiments of this application with reference to the accompanyingdrawings.

In the video shooting method provided in this application, a cameramovement shooting technique such as “moving a lens” or “shaking a lens”may be implemented when the mobile phone remains stationary.

For ease of description, in this specification, “moving a lens” isreferred to as a “move mode”; “shaking a lens” is referred to as a“shake mode”; and the “move mode”, the “shake mode”, and the like arecollectively referred to as a “camera movement mode”. Herein, only the“move mode” and the “shake mode” are used as examples. It can beunderstood that the camera movement mode may be more specific. Forexample, the move mode may include an upward move mode, a downward movemode, a leftward move mode, and a rightward move mode according to amovement direction, and may include an accelerated move mode, a constantmove mode, and a decelerated move mode according to a movement speed.For example, referring to Table 1, various camera movement modes arelisted.

TABLE 1 Various camera movement modes Direction Speed Camera Move modeRightward move mode Accelerated, constant, and decelerated movementLeftward move mode Accelerated, constant, and decelerated mode Upwardmove mode Accelerated, constant, and decelerated Downward move modeAccelerated, constant, and decelerated Shake mode Rightward shake modeAccelerated, constant, and decelerated Leftward shake mode Accelerated,constant, and decelerated Upward shake mode Accelerated, constant, anddecelerated Downward shake mode Accelerated, constant, and deceleratedPush a lens Accelerated, constant, and decelerated Pull a lensAccelerated, constant, and decelerated Rotate mode Clockwise rotate modeAccelerated, constant, and decelerated Counterclockwise Accelerated,constant, and decelerated rotate mode

The 36 camera movement modes in Table 1 are used as an example. It canbe understood that more modes may be further included. For example, inaddition to the upward movement, the downward movement, the leftwardmovement, and the rightward movement, the move mode may further includemovements in other directions, which are not enumerated one by oneherein.

The following describes implementation principles of the various “cameramovement modes” when the mobile phone remains stationary.

(1) Move Mode

The mobile phone starts a camera such as a wide-angle camera or anultra-wide-angle camera. The camera outputs an image stream. Referringto FIG. 3A-(a), a largest block represents an image that is output bythe camera, and generally represents an image including a relativelylarge quantity of to-be-shot objects. For ease of description, only anm^(th) frame of image to an (m+3)^(th) frame of image in the imagestream are captured as an example in FIG. 3A-(a). For example, for them^(th) frame of image, a small block in a corresponding large block ismarked as an m^(th) region, and an image block in the m^(th) region maybe obtained through clipping and displayed on a display as a previewimage. In other words, a preview image displayed on the mobile phone isan image block obtained through clipping from an image captured by thecamera. The descriptions herein are also applicable to the shake mode,the push mode, the pull mode, and the like below.

A rightward movement is used as an example. Assuming that the rightwardmovement starts from the m^(th) frame, referring to FIG. 3A-(a), apreview image is the image block in the m^(th) region on the m^(th)frame of image; a next frame of preview image is an image block in an(m+1)^(th) region on the (m+1)^(th) frame of image, where a position ofthe (m+1)^(th) region moves rightward by a distance A relative to thatof the m^(th) region; a next frame of preview image is an image block inan (m+2)^(th) region on the (m+2)^(th) frame of image, where a positionof the (m+2)^(th) region moves rightward by a distance B relative tothat of the (m+1)^(th) region, and the position of the (m+2)^(th) regionmoves rightward by a distance A+B relative to that of the m^(th) region;and so on. The m^(th) region, the (m+1) region, the (m+2)^(th) region,and the like are collectively referred to as a target region. In otherwords, a position of the target region on the image captured by thecamera gradually moves rightward. This achieves a lens rightwardmovement effect. However, the mobile phone does not move actually.

An example in which the m^(th) region is a central region on the m^(th)frame of image is used in FIG. 3A-(a). It can be understood that them^(th) region may alternatively be another region on the m^(th) frame ofimage. For example, a left edge of the m^(th) region overlaps a leftedge of the m^(th) frame of image. To be specific, the target regionmoves from the leftmost to the rightmost of the image.

FIG. 3A-(a) is described by using the rightward movement as an example.It can be understood that movements in various directions such as aleftward movement, an upward movement, a downward movement, and adiagonal movement may be further included, and have a same principle asthe rightward movement. Details are not described again.

The following provides a specific example. For ease of simplification,an example of updating a preview image by one frame per second is used.

It is assumed that an image in the image stream that is output by thecamera is 4148*2765, and a target region is 2094*1178. An example inwhich a target region moves from the leftmost to the rightmost of animage is used, and an example of a constant movement is used. Referringto FIG. 3B-4 a), FIG. 3B-(b), and FIG. 3B-(c), the rightward movementmeans that a center point of a target region moves from −1027 to +1027in an X direction. In this case, it takes 3 seconds to complete aleftmost-to-rightmost translation. Herein, the rightward movement isused as an example. It can be understood that the leftward movement hasa same principle as the rightward movement. Details are not describedagain. In addition, the example of performing updating by one frame persecond is used herein. It can be understood that updating may beperformed by a plurality of frames per second during actual application.

Likewise, the upward translation means that a center point of a targetregion moves from −793 to +793 in a Y direction. In this case, it takes3 seconds (or user-specified duration) to complete abottommost-to-uppermost translation. Herein, the upward movement is usedas an example. It can be understood that the downward movement has asame principle as the upward movement. Details are not described again.

(2) Shake Mode

Different from the move mode, in the shake mode, in addition to that aposition of a target region on an image captured by the camera needs tobe changed, angle of view conversion further needs to be performed on animage block in the target region, and a preview image is an image blockobtained after the angle of view conversion. For example, the mobilephone may first perform angle of view conversion on an image (forexample, an m^(th) frame of image) captured by the camera, and thendetermine that an image block in a target region on an image obtainedafter the angle of view conversion is a preview image; or the mobilephone may first determine an image block in a target region on an imagecaptured by the camera, then perform angle of view conversion on theimage block, and determine that an image block obtained after the angleof view conversion is a preview image.

A right shake is used as an example. Assuming that the right shakestarts from the m^(th) frame, referring to FIG. 3A-(a), a preview imageis an image block obtained after angle of view conversion is performedon an image block in an m^(th) region, a next frame of preview image isan image block obtained after angle of view conversion is performed onan image block in an (m+1)^(th) region, a next frame of preview image isan image block obtained after angle of view conversion is performed onan image block in an (m+2)^(th) region, and so on. This achieves a lensrightward-shake effect. However, a position of the mobile phone does notchange actually.

The angle of view conversion may be implemented through affinetransformation. For example, the affine transformation includes:multiplying a pixel on an image by a linear transformation matrix, andadding a translation vector to obtain an image obtained after angle ofview conversion. For example, the image obtained after the angle of viewconversion satisfies the following formula:

$\begin{bmatrix}x^{\prime} \\y^{\prime} \\1\end{bmatrix} = {{\begin{bmatrix}{m11} & {m12} & {m13} \\{m21} & {m22} & {m23} \\0 & 0 & 1\end{bmatrix}\begin{bmatrix}x \\y \\1\end{bmatrix}}.}$

The following formulas may be obtained according to the foregoingformula:

x′=m11*x+m12*y+m13; and

y′=m21*x+m22*y+m23.

Herein, (x′, y′) is a pixel on the image obtained after the angle ofview conversion; (x, y) is a pixel on the image obtained before theangle of view conversion; and the matrix

$\begin{bmatrix}{m11} & {m12} & {m13} \\{m21} & {m22} & {m23} \\0 & 0 & 1\end{bmatrix}$

in the formula is a matrix used to implement linear transformation andtranslation. In addition, m11, m12, m21, and m22 are lineartransformation parameters; m13 and m23 are translation parameters; andm11, m12, m21, and m22 are related to a rotation angle. Assuming that arotation angle of “shaking a lens” is θ, m11=cos(θ), m12=−sin(θ),m21=sin(θ), m22=cos(θ), m13=0, and m23=0. Therefore, the followingformulas may be obtained by deforming the foregoing formulas:

x′=x*cos(θ)−sin(θ)*y; and

y′=x*sin(θ)+cos(θ)*y.

For example, the rotation angle θ may be determined in a plurality ofmanners. For example, the rotation angle θ is a preset fixed value, ormay be set by a user. Therefore, after determining the rotation angle,the mobile phone may perform angle of view conversion according to theforegoing formulas.

(3) Push Mode

The push mode corresponds to a shooting manner of “pushing a lens”,which can be understood as that the camera gradually approaches anobject, to be specific, a to-be-shot object on a viewfinder interface ismagnified. This helps focus on object details.

Referring to FIG. 3A-(b), for example, for an m^(th) frame of image, acorresponding large block includes a small block, that is, an m^(th)region, and the mobile phone obtains an image block from the m^(th)region through clipping and displays the image block on a screen.

Assuming that the push mode starts from the m^(th) frame, stillreferring to FIG. 3A-(b), a preview image is the image block obtainedfrom the m^(th) region on the m^(th) frame of image through clipping; anext frame of preview image is an image block obtained from an(m+1)^(th) region through clipping, where an area of the (m+1)^(th)region is less than an area of the m^(th) region; a next frame ofpreview image is an image block obtained from an (m+2)^(th) regionthrough clipping, where an area of the (m+2)^(th) region is less thanthe area of the m^(th) region; and so on. In other words, an image blockarea is becoming smaller. In this case, when an image block is displayedon the display, to adapt to a size of the display, the image block needsto be magnified for display. A smaller image block indicates a largermagnification. Therefore, a to-be-shot object in a preview image on themobile phone is gradually magnified. This achieves a shooting effectthat the camera gradually approaches an object. However, a position ofthe mobile phone does not change.

(4) Pull Mode

The pull mode corresponds to a shooting manner of “pulling a lens”,which can be understood as that the camera gradually moves away from anobject, to be specific, a to-be-shot object on a viewfinder interface isde-magnified. This helps panoptic shooting.

Different from the pull mode, assuming that the push mode starts from anm^(th) frame, a preview image is an image block in an m^(th) region onthe m^(h) frame of image; a next frame of preview image is an imageblock in an (m+1)^(th) region on an (m+1)^(th) frame of image, where anarea of the (m+1)^(th) region is greater than an area of the m^(th)region; a next frame of preview image is an image block in an (m+2)^(th)region on an (m+2)^(th) frame of image, where an area of the (m+2)^(th)region is greater than the area of the (m+1)^(th) region; and so on. Inother words, an image block area is becoming larger. In this case, whenan image block is displayed on the display, to adapt to a size of thedisplay, the image block needs to be de-magnified for display. A largerimage block indicates a larger de-magnification. Therefore, a to-be-shotobject in a preview image on the mobile phone is de-magnified. Thisachieves an effect that the camera gradually moves away from ato-be-shot object. However, a position of the mobile phone does notchange.

(5) Rotate Mode

In the rotate mode, in addition to determining an image block in atarget region, the mobile phone further needs to rotate the image block.For example, the mobile phone may first rotate an image captured by thecamera, and then determine that an image block in a target region on arotated image is a preview image; or the mobile phone may firstdetermine an image block in a target region on an image captured by thecamera, then rotate the image block, and determine that a rotated imageblock is a preview image.

Clockwise rotation is used as an example. Assuming that the rotationstarts from an m^(th) frame, referring to FIG. 3A-(c), a preview imageis an image block in an m^(th) region, a next frame of preview image isan image block obtained after an image block in an (m+1)^(th) regionrotates clockwise by an angle G, a next frame of preview image is animage block obtained after an image block in an (m+2)^(th) regionrotates clockwise by an angle G+P, and so on. In other words, a targetregion gradually rotates clockwise. Therefore, a to-be-shot object on apreview image gradually rotates clockwise. This achieves a rotationshooting effect of the mobile phone. However, a position of the mobilephone does not change.

FIG. 3A-(c) is described by using the clockwise rotation as an example.It can be understood that counterclockwise rotation may be furtherincluded, and has a same principle as the clockwise rotation. Detailsare not described again.

(6) Constant Mode

The constant mode includes a constant move mode, a constant shake move,a constant push mode, a constant pull mode, a constant rotate mode, andthe like. More specifically, the constant movement may further includethe constant upward movement, the constant downward movement, theconstant leftward movement, the constant rightward movement, and thelike, and the constant rotation may further include the constantclockwise rotation, the constant counterclockwise rotation, and thelike. This is shown in Table 1.

The constant movement is used as an example, to be specific, theconstant rightward movement is used as an example. Referring to FIG.3A-(a), for example, A=B=C, to be specific, the target region (forexample, the m^(th) region, the (m+1)^(th) region, and the (m+2)^(th)region) moves by a same distance each time. This achieves a constantrightward movement effect.

The constant push is used as an example. Referring to FIG. 3A-(b), thetarget region (for example, the m^(th) region, the (m+1)^(th) region,and the (m+2)^(th) region) is decreased by a same area each time. Thisachieves a constant push shooting effect.

The constant rotation is used as an example, to be specific, theconstant clockwise rotation is used as an example. Referring to FIG.3A-(c), for example, G=P=W, to be specific, the target region (forexample, the m^(th) region, the (m+1)^(th) region, and the (m+2)^(th)region) rotates by a same angle each time. This achieves a constantrotation effect.

(7) Accelerated Mode

The accelerated mode includes an accelerated move mode, an acceleratedshake move, an accelerated push mode, an accelerated pull mode, anaccelerated rotate mode, and the like. More specifically, theaccelerated movement may further include the accelerated upwardmovement, the accelerated downward movement, the accelerated leftwardmovement, the accelerated rightward movement, and the like; and theaccelerated rotation may further include the accelerated clockwiserotation, the accelerated counterclockwise rotation, and the like. Thisis shown in Table 1.

The accelerated movement is used as an example, to be specific, theaccelerated rightward movement is used as an example. Referring to FIG.3A-(a), for example, A<B<C, to be specific, the target region (forexample, the m^(th) region, the (m+1)^(th) region, and the (m+2)^(th)region) moves by an increasing distance each time. This achieves anaccelerated rightward movement effect.

The accelerated push is used as an example. Referring to FIG. 3A-(b), anarea reduction amount of the target region (for example, the m^(th)region, the (m+1)^(th) region, and the (m+2)^(th) region) graduallyincreases. For example, a first area difference between the (m+1)^(th)region and the m^(th) region is less than a second area differencebetween the (m+2)^(th) region and the (m+1)^(th) region. This achievesan accelerated push effect.

The accelerated rotation is used as an example, to be specific, theaccelerated clockwise rotation is used as an example. Referring to FIG.3A-(c), for example, G<P<W, to be specific, the target region (forexample, the m^(th) region, the (m+1)^(th) region, and the (m+2)^(th)region) rotates by an increasing angle each time. This achieves anaccelerated rotation effect.

The accelerated rightward movement is still used as an example. Theaccelerated rightward movement may be implemented in another manner inaddition to a manner of setting that A, B, and C satisfy A<B<C. Forexample, still referring to FIG. 3A-(a), it is set that A=B=C; and thenthe accelerated movement is implemented through frame extraction. Forexample, the m^(th) frame, the (m+1)^(th) frame, and the (m+3)^(th)frame are extracted. In this case, preview images are successively animage block in the m^(th) region, an image block in the (m+1)^(th)region, and an image block in the (m+3)^(th) region. However, the(m+1)^(th) region moves rightward by a distance A relative to the m^(th)region, and the (m+3)^(th) region moves rightward by a distance B+Crelative to the (m+1)^(th) region. This implements the acceleratedrightward movement.

(8) Decelerated Mode

The decelerated mode includes a decelerated move mode, a deceleratedshake move, a decelerated push mode, a decelerated pull mode, adecelerated rotate mode, and the like. More specifically, thedecelerated movement may further include the decelerated upwardmovement, the decelerated downward movement, the decelerated leftwardmovement, the decelerated rightward movement, and the like, and thedecelerated rotation may further include the decelerated clockwiserotation, the decelerated counterclockwise rotation, and the like. Thisis shown in Table 1.

The decelerated movement is used as an example, to be specific, thedecelerated rightward movement is used as an example. Referring to FIG.3A-(a), for example, A>B>C, to be specific, the target region (forexample, the m^(th) region, the (m+1)^(th) region, and the (m+2)^(th)region) moves by a decreasing distance each time. This achieves adecelerated rightward movement effect.

The decelerated push is used as an example. Referring to FIG. 3A-(b), anarea reduction amount of the target region (for example, the m^(th)region, the (m+1)^(th) region, and the (m+2)^(th) region) graduallydecreases. For example, a first area difference between the (m+1)^(th)region and the m^(th) region is greater than a second area differencebetween the (m+2)^(th) region and the (m+1)^(th) region. This achieves adecelerated push effect.

The decelerated rotation is used as an example, to be specific, thedecelerated clockwise rotation is used as an example. Referring to FIG.3A-(c), for example, G>P>W, to be specific, the target region (forexample, the m^(th) region, the (m+1)^(th) region, and the (m+2)^(th)region) rotates by a decreasing angle each time. This achieves adecelerated rotation effect.

The decelerated rightward movement is still used as an example. Thedecelerated rightward movement may be implemented in another manner inaddition to a manner of setting that A, B, and C satisfy A>B>C. Forexample, still referring to FIG. 3A-(a), it is set that A=B=C; and thenthe decelerated movement is implemented through frame insertion. Forexample, a p^(th) frame is inserted between the m^(th) frame and the(m+1)^(th) frame; and a target region on the p^(th) frame is a p^(th)region and moves rightward by X relative to the m^(th) region, where Xis less than A. In this case, preview images are successively an imageblock in the m^(th) region, an image block in the p^(th) region, animage block in the (m+1)^(th) region, and the like. In addition, thep^(th) region moves rightward by X relative to the m^(th) region, andthe (m+1)^(th) region moves rightward by A relative to the m^(th)region. This achieves a decelerated rightward movement effect. However,a position of the mobile phone does not change.

The following describes a process of performing video shooting by usingthe various “camera movement modes” when the mobile phone remainsstationary.

Generally, to bring an ultimate viewing effect to the audience, a largequantity of camera movement shooting techniques such as “moving a lens”,“shaking a lens”, and “pushing/pulling a lens” are used in a movieshooting process. However, the movie shooting requires professionalequipment and photographers. Therefore, in this application, it isconsidered that movie-similar shooting is implemented through a mobilephone by using various camera movement modes when the mobile phoneremains stationary. For example, a micro movie mode (or may be referredto as a movie mode) may be provided in the mobile phone. In the micromovie mode, a user may use the mobile phone to perform movie-similarshooting. Specifically, the micro movie mode includes a plurality ofstory templates, and each story template includes a plurality ofdifferent camera movement modes. The mobile phone may perform videoshooting by using different camera movement modes included in a storytemplate, thereby improving video shooting quality and facilitating anoperation, even non-professional photographers can use various cameramovement modes to complete shooting, thereby improving video shootinginterest to a specific extent.

The following specifically describes the technical solutions in theembodiments of this application with reference to the accompanyingdrawings.

FIG. 4(a) shows a graphical user interface (graphical user interface,GUI) of a mobile phone. The GUI is a home screen (home screen) of themobile phone. The home screen includes icons of a plurality ofapplications, for example, an icon of a camera application. Whendetecting an operation that a user taps the icon of the cameraapplication, the mobile phone starts the camera application, anddisplays another GUI shown in FIG. 4(b), where the GUI may be referredto as a viewfinder interface (or a shooting interface). A preview imagemay be displayed on the viewfinder interface in real time.

After detecting an operation that the user indicates a micro movie mode,the mobile phone enters (or starts) the micro movie mode. In the micromovie mode, the mobile phone may perform video recording by usingvarious story templates.

The user may indicate the micro movie mode in a plurality of manners.

For example, the viewfinder interface includes a button used to indicatethe micro movie mode. When detecting an operation that the user taps thebutton, the mobile phone enters the micro movie mode.

For example, the button may be a button 501 shown in FIG. 5A-(a).Alternatively, the button may be displayed at a position shown in FIG.5A-(b). Optionally, when a video recording mode is entered, the buttonis displayed on the viewfinder interface, and the button may not bedisplayed in a photo mode. Alternatively, the button may be displayed ata position shown in FIG. 5A-(c). A display position of the button may beset by the mobile phone by default, or may be set by the user. This isnot limited.

Alternatively, as shown in FIG. 4(b), when detecting an operation oftapping a button “More”, the mobile phone displays a mode selectioninterface shown in FIG. 5B. The interface includes an icon of the micromovie mode. When detecting an operation that the user taps the icon, themobile phone enters the micro movie mode.

Alternatively, when detecting a preset gesture operation of the user onthe viewfinder interface, the mobile phone enters the micro movie mode.For example, the preset gesture operation may be a gesture operation ofdrawing a circle on the viewfinder interface, or an operation oftouching and holding a preview image on the viewfinder interface. Thisis not limited in this embodiment.

Alternatively, after the mobile phone displays the viewfinder interface,if the mobile phone detects a user voice that indicates to enter themicro movie mode, the mobile phone enters the micro movie mode.

After entering the micro movie mode, the mobile phone may display aplurality of story templates. Each story template may include aplurality of camera movement modes.

Optionally, to help the user intuitively understand the story templates,the mobile phone may further provide a video sample corresponding toeach story template. A video sample may be understood as a finishedproduct that has been recorded by using a story template. For example,the story templates include a travel template. A video samplecorresponding to the travel template includes three video clips, andeach video clip is shot in one camera movement mode. In this way, theuser can roughly know a shooting effect of the travel template bywatching the video sample corresponding to the travel template.

For example, for an interface displayed after the mobile phone entersthe micro movie mode, refer to FIG. 6(a). For ease of description, theinterface is referred to as a home page of the micro movie mode below.The home page includes a plurality of story templates, for example, atravel template, a quiet template, and a dynamic template shown in FIG.6(a).

The home page may further include a preview box 601 for displaying avideo sample corresponding to a story template. For example, whendetecting an operation that the user selects the travel template (forexample, an operation of tapping the travel template), the mobile phonedisplays a video sample corresponding to the travel template in thepreview box 601.

Because the video sample corresponding to the travel template isobtained by synthesizing the three sample clips, the video sample may bedirectly played or each sample clip may be played in the preview box601. For example, after a first sample clip is played in the preview box601, a next sample clip is automatically played, or a next sample clipis automatically played after a period of time. To help the userdetermine a specific sample clip that is being played in the preview box601, the mobile phone may output a specific prompt. For example, asshown in FIG. 6(a), when the first sample clip is being played in thepreview box 601, a first small circle in a mark 602 is in a first color(for example, black), and the other two small circles are in a secondcolor (for example, white); or when the second sample clip is beingplayed in the preview box 601, a second small circle in a mark 602 is ina first color (for example, black), and the other two small circles arein a second color (for example, white).

Alternatively, when detecting an operation that the user selects thefirst sample clip, the mobile phone plays the first sample clip in thepreview box 601. When detecting an operation of selecting the secondsample clip, the mobile phone plays the second sample clip in thepreview box 601. For example, still referring to FIG. 6(a), the firstsample clip is displayed in the preview box 601 by default. When themobile phone detects a left-flick operation of the user in the previewbox 601, the preview box 601 includes a next sample clip. When themobile phone detects a left-flick operation of the user in the previewbox 601 again, the preview box 601 includes a next sample clip. Inaddition, the mark 602 may also prompt the user with a sample clip thatis being played in the preview box 601.

Optionally, the video sample may include music, and the music may be setby default, for example, may be set in the travel template as anauxiliary.

Optionally, a quantity of sample clips, total recording duration of thetravel template, recording duration of each video clip, and the like maybe further displayed in the preview box 601 in addition to the mark 602.

Because the user may want to know a camera movement mode used for eachstory template, the mobile phone may display a prompt to the user on atouchscreen or may prompt the user in a sound manner, to notify the userof a camera movement mode used for a story template. For example,referring to FIG. 6(a), when the travel template is selected, a button“Details” may be further displayed in the preview box 601 in addition tothe video sample corresponding to the travel module. When detecting anoperation that the user taps the button “Details”, the mobile phonedisplays an interface shown in FIG. 6(b). The interface includes acamera movement mode used for each sample clip included in the traveltemplate. For example, a rightward move mode is used for the firstsample clip, a push mode is used for the second sample clip, and aclockwise rotate mode is used for the third sample clip. For ease ofdescription, a constant speed is used as an example herein.

It should be noted that, when the video sample corresponding to thetravel template is being displayed in the preview box 601, the button“Details” may be used to view a camera movement mode used for the traveltemplate. Therefore, it can be understood that, when a video samplecorresponding to the quiet template is being displayed in the previewbox 601, the button “Details” may be used to view a camera movement modeused for the quiet module. Details are not described again.

Still referring to FIG. 6(a), the home page further includes a control603, and the control 603 is used to enter a recording interface of astory template. For example, assuming that the mobile phone detects anoperation that the user selects the travel template and then taps thecontrol 603, the mobile phone enters a recording interface of the traveltemplate.

For example, the recording interface of the travel template is shown inFIG. 7A. The recording interface includes a prompt 701 for prompting theuser that the mobile phone is being in the travel template. Certainly,the prompt 701 may alternatively not be displayed. The recordinginterface further includes three marks: a mark 702 to a mark 704. Themark 702 is used to indicate a first camera movement mode used for thetravel mode, the mark 703 is used to indicate a second camera movementmode, and the mark 704 is used to indicate a third camera movement mode.

Optionally, a time 1 is displayed in the mark 702, and the time 1 isused to indicate recording duration of using the first camera movementmode. Likewise, a time 2 is displayed in the mark 703, and the time 2 isused to indicate recording duration of using the second camera movementmode. A time 3 is displayed in the mark 704, and the time 3 is used toindicate recording duration of using the third camera movement mode. Thetime 1, the time 2, and the time 3 may be set by default, and may be thesame or may be different (an example in which the time 1, the time 2,and the time 3 each are 3 s is used in FIG. 7A). Alternatively, the time1, the time 2, and the time 3 may be set by the user (which is describedbelow).

A button 706 is further displayed on the recording interface for closingthe recording interface of the travel template. Assuming that the mobilephone detects an operation of tapping the button 706, the home pageshown in FIG. 6(a) is returned.

A button 705 is further displayed on the recording interface.Optionally, the button 705 may be a recording button for controllingstart and/or stop of recording.

Manner 1: The travel template includes three camera movement modes, andfor each camera movement mode, the button 705 may be used to controlstart and/or stop of recording.

Still referring to FIG. 7A, when detecting an operation of selecting themark 702 (for example, tapping the mark 702), the mobile phonedetermines the first camera movement mode corresponding to the mark 702.When detecting an operation of tapping the button 705, the mobile phonestarts video shooting in the first camera movement mode. An example inwhich the first camera movement module is the rightward move mode isused. For an implementation principle thereof, refer to the descriptionsin FIG. 3A-(a). For a recording effect thereof, refer to FIG. 7B-(a) toFIG. 7B-(c). Specifically, as shown in FIG. 7B-(a), a to-be-shot object“tower” in a preview image is on a right side in the image; as shown inFIG. 7B-(b), “tower” in a preview image is in the middle of the image;and as shown in FIG. 7B-(c), “tower” in a preview image is on a leftside in the image. This is equivalent to an effect that the mobile phonemoves rightward. However, the mobile phone does not move actually.

In a process in which the mobile phone performs video shooting in thefirst camera movement mode, the time in the mark 702 automaticallydecreases. For example, the time in the mark 702 is 3 s in FIG. 7B-(a),the time in the mark 702 decreases to 2 s in FIG. 7B-(b), and the timein the mark 702 decreases to Is in FIG. 7B-(c). When the time decreasesto 0, the recording stops. In this case, the process in which the mobilephone performs recording in the first camera movement mode ends.

For another example, referring to FIG. 7A, when detecting an operationof selecting the mark 703 (for example, tapping the mark 703), themobile phone determines the second camera movement mode corresponding tothe mark 703. When detecting an operation of tapping the button 705, themobile phone starts video shooting in the second camera movement mode.An example in which the second camera movement module is the push modeis used. For an implementation principle thereof, refer to thedescriptions in FIG. 3A-(b). For a recording effect thereof, refer toFIG. 7C-(a) to FIG. 7C-(c). Specifically, as shown in FIG. 7C-(a), ato-be-shot object “tower” in a preview image is relatively far visually,and therefore “tower” is relatively small; as shown in FIG. 7C-(b).“tower” in a preview image is magnified, so that the user feels close to“tower”; and as shown in FIG. 7C-(c), “tower” in a preview image isfurther magnified. This is equivalent to an effect that the mobile phoneapproaches an object. However, the mobile phone does not move actually.

Likewise, in a process in which the mobile phone performs recording inthe second camera movement mode, the time in the mark 703 automaticallydecreases. When the time decreases to 0, the recording stops. In thiscase, the process in which the mobile phone performs recording in thesecond camera movement mode ends.

For another example, referring to FIG. 7A, when detecting an operationof selecting the mark 704 (for example, tapping the mark 704), themobile phone determines the third camera movement mode corresponding tothe mark 704. When detecting an operation of tapping the button 705, themobile phone starts video shooting in the third camera movement mode. Anexample in which the third camera movement module is the clockwiserotate mode is used. For an implementation principle thereof, refer tothe descriptions in FIG. 3A-(c). For a recording effect thereof, referto FIG. 7D-(a) to FIG. 7D-(c). Specifically, as shown in FIG. 7D-(a), ato-be-shot object “tower” in a preview image is perpendicular; as shownin FIG. 7D-(b), “tower” in a preview image rotates clockwise; and asshown in FIG. 7D-(c), “tower” in a preview image further rotates. Thisis equivalent to a shooting effect that the mobile phone rotatesclockwise. However, the mobile phone does not move actually.

Likewise, in a process in which the mobile phone performs recording inthe camera movement mode 3, the time in the mark 704 automaticallydecreases. When the time decreases to 0, the recording stops. In thiscase, the process in which the mobile phone performs recording in thethird camera movement mode ends.

Therefore, in Manner 1, the user selects a camera movement mode by usingthe mark 702 to the mark 704, and then controls, by using the button705, the mobile phone to start shooting in the selected camera movementmode.

Certainly, the button 705 may also control stop of shooting. FIG. 7A isused as an example. The user selects the first camera movement mode.When detecting an operation of tapping the button 705, the mobile phonestarts recording in the first camera movement mode; and when detectingan operation of tapping the button 705 again, the mobile phone stops therecording in the first camera movement mode. The second camera movementmode and the third camera movement mode have a same principle as thefirst camera movement mode. Details are not described again. In otherwords, for each camera movement mode, the button 705 not only can beused to control start of recording, but also can be used to control stopof the recording. In this case, recording duration corresponding to eachcamera movement mode may not be preset. For example, the recordingduration may be determined by the user. When the user wants to stoprecording, the user taps the button 705.

Manner 2: In Manner 1, for each camera movement mode, the user needs totap the button 705 once to start recording. Different from Manner 1, inManner 2, when detecting an operation on the button 705, the mobilephone automatically performs recording sequentially in the three cameramovement modes. For example, referring to FIG. 7A, when detecting anoperation of tapping the button 705, the mobile phone first startsrecording in the first camera movement mode, stops the recording whenrecording duration reaches preset duration (for example, 3 s), thenautomatically starts recording in the second camera movement mode, andperforms recording in the third camera movement mode. In this manner,the user only needs to tap the button 705 once, so that an operation isconvenient. Certainly, in Manner 2, the button 705 may also be used tocontrol stop or pause of recording. Details are not described again.

Likewise, in Manner 2, in a process in which the mobile phone performsrecording in the first camera movement mode, the time in the mark 702may gradually decrease. When the time decreases to 0, the recording inthe first camera movement mode stops. A principle of recording in thesecond camera movement mode and the third camera movement mode is thesame as a principle of recording in the first camera movement mode.Details are not described again.

Alternatively, the button 705 may be a video synthesis button forsynthesizing recorded clips into a video.

For example, the mark 702 to the mark 704 are used as recording buttons.Still referring to FIG. 7A, when detecting an operation of tapping themark 702, the mobile phone starts recording in the first camera movementmode, stops the recording when recording duration (for example, 3 s) isreached, and stores a recorded clip (which is referred to as a clip 1for ease of distinguishing). When detecting an operation of tapping themark 703, the mobile phone obtains a clip 2 through recording in thesecond camera movement mode. When detecting an operation of tapping themark 704, the mobile phone obtains a clip 3 through recording in thethird camera movement mode. When detecting an operation of tapping thebutton 705, the mobile phone synthesizes the clip 1 to the clip 3 intoone video.

Likewise, in a process in which the mobile phone performs recording inthe first camera movement mode, the time in the mark 702 may graduallydecrease. When the time decreases to 0, the recording in the firstcamera movement mode stops. A principle of recording in the secondcamera movement mode and the third camera movement mode is the same as aprinciple of recording in the first camera movement mode. Details arenot described again.

Optionally, recording duration (for example, 3 s) corresponding to eachcamera movement mode may not be preset. For example, when detecting anoperation of tapping the mark 702, the mobile phone starts recording inthe first camera movement mode; and when detecting an operation oftapping the mark 702 again, the mobile phone stops the recording in thefirst camera movement mode. The second camera movement mode and thethird camera movement mode have a same principle as the first cameramovement mode. In other words, the mark 702 is used to control start andstop of recording in the first camera movement mode. To be specific, foreach camera movement mode, the recording duration may be determined bythe user.

An example in which the recording duration corresponding to each cameramovement mode is preset and is 3 s is used above. It can be understoodthat the recording duration corresponding to each camera movement modemay be adjusted. For example, referring to FIG. 8A-(a), when detectingan operation (for example, a touch and hold operation) on the mark 702,the mobile phone may display a selection box, where the selection boxincludes a button “Time setting”. When an operation on the button “Timesetting” is detected, an interface shown in FIG. 8A-(b) is displayed. Abutton “+” and a button “−” are displayed on the interface. The button“+” is used to increase a time, for example, increase the time to 4 s.The button “−” is used to decrease a time, for example, decrease thetime to 2 s.

It should be noted that an example in which the travel template includesthree camera movement modes is used in FIG. 7A It can be understood thatthe travel template may further include more or fewer camera movementmodes. For example, the user may add or delete a camera movement mode.

An example of deleting a camera movement mode is used. For example,referring to FIG. 8A-(a), when detecting an operation (for example, atouch and hold operation) on the mark 702, the mobile phone displays theselection box, where the selection box includes a button “Delete”. Whenthe mobile phone detects an operation on the button “Delete”, the mark702 is deleted, and correspondingly the first camera movement modecorresponding to the mark 702 is deleted.

An example of adding a camera movement mode is used. For example,referring to FIG. 8B-(a), the recording interface of the travel modefurther includes a button “+”. When detecting an operation (for example,a tap operation) on the button “+”, the mobile phone displays aninterface shown in FIG. 8B-(b), where the interface includes a cameramovement mode list. After the user selects a camera movement mode, ifthe mobile phone detects an operation of tapping a button “Add”, aninterface shown in FIG. 8B-(c) is displayed, and a mark 707 is added tothe interface to indicate the user to select an added camera movementmode.

Optionally, an order of different camera movement modes may be adjusted.For example, referring to FIG. 8C, when the mobile phone detects anoperation of touching and holding and dragging the mark 704, the mark704 is in a movable state. When it is detected that the mark 704 isdragged to a position between the mark 702 and the mark 703, an order ofthe three camera movement modes is adjusted as follows, the first cameramovement mode, the third camera movement mode, and the second cameramovement mode. In this case, an order of the three clips in thesynthetic video is as follows: the clip 1, the clip 3, and the clip 2.The clip 1 is obtained through shooting in the first camera movementmode, the clip 2 is obtained through shooting in the second cameramovement mode, and the clip 3 is obtained through shooting in the thirdcamera movement mode.

After the mobile phone enters the recording interface of the traveltemplate (for example, the interface in FIG. 7A), the user may notremember a specific camera movement mode included in the traveltemplate. Therefore, to help the user view a camera movement modeincluded in the travel template, the user may be prompted with thecamera movement mode of the travel mode on the recording interface ofthe travel mode. For example, referring to FIG. 8D-(a), when detectingan operation of tapping the button 603, the mobile phone enters aninterface shown in FIG. 8D-(b). The interface includes a widget. Thevideo sample corresponding to the travel template may be played in thewidget, or each sample clip may be played in the widget. For example, asshown in FIG. 8D-(b), when the mobile phone detects an operation on themark 702, the first sample clip is played in the widget (for example,the sample clip 1 is cyclically played or is played only once). When themobile phone detects an operation on the mark 703, the second sampleclip is played in the widget (for example, the sample clip 1 iscyclically played or is played only once). In this way, in a recordingprocess, the user can view a camera movement mode used by each sampleclip.

Optionally, after completing video shooting by using the traveltemplate, the mobile phone may enter an effect presentation interface.This helps the user view a shooting effect.

Manner 2 is used as an example. Referring to FIG. 9A-(a), afterrecording in the last camera movement mode reaches the recordingduration (for example, 3 s), the mobile phone may automatically enter aneffect presentation interface shown in FIG. 9A-(b). A preview box 901 isdisplayed on the interface for displaying a video obtained bysynthesizing the three video clips. If the mobile phone detects anoperation on a button “OK”, the mobile phone stores the synthetic video.For example, an interface shown in FIG. 9A-(a) is returned, and an imagein the synthetic video is displayed in a gallery mark in a bottom-leftcorner of the interface. If the user is not satisfied with the syntheticvideo, the user may perform rerecording. For example, when the mobilephone detects an operation on a button “Back”, the mobile phone returnsto the interface shown in FIG. 9A-(a) to perform rerecording.Optionally, the preview box 901 may occupy a part of the display or theentire display. If the entire display is occupied, the button “OK” andthe button “Back” may be displayed above the preview box 901.

It should be noted that an example in which the synthetic video isdisplayed in the preview box 901 is used in FIG. 9A-(b). It can beunderstood that each video clip may alternatively be displayed. Forexample, FIG. 9B-(a) shows an example of another effect presentationinterface. The interface includes a mark of each video clip. Forexample, when the mobile phone detects an operation (for example, a tapoperation) on the mark of the clip 1, the clip 1 is played in thepreview box 901. When the mobile phone detects an operation on the markof the clip 2, the clip 2 is played in the preview box. Therefore, theuser can view each recorded video clip. When the mobile phone detects anoperation of tapping a button “OK”, the mobile phone synthesizes thethree clips into a video, stores the synthetic video, and returns to theinterface shown in FIG. 9A-(a).

Optionally, an order of the three video clips may be adjusted. Forexample, still referring to FIG. 9B-(a), the mobile phone detects anoperation (for example, an operation of touching and holding anddragging) on the mark of the clip 2, and changes a display position ofthe mark, for example, drags the mark of the clip 3 to a positionbetween the mark of the clip 1 and the mark of the clip 2, as shown inFIG. 9B-(b). Therefore, an order of the clip 3 and the clip 2 isadjusted. In this case, if the mobile phone detects an operation on thebutton “OK”, an order of displaying the video clips in a synthetic videois as follows: the clip 1, the clip 3, and the clip 2.

Optionally, some cases are considered. For example, the user is notsatisfied with a video clip in the three video clips. In this case, thevideo clip may be deleted, and the remaining video clips are synthesizedinto a video. For example, referring to FIG. 9C-(a), when detecting anoperation (for example, a touch and hold operation) on the mark of theclip 2, the mobile phone displays a button “Delete”. Referring to FIG.9C-(b), when the mobile phone detects an operation on the button“Delete”, the clip 3 is deleted. In this case, if the mobile phonedetects an operation on a button “OK”, the mobile phone synthesizes theclip 1 and the clip 2 into a video.

Alternatively, if the user is not satisfied with a video clip, the usermay rerecord the clip. For example, still referring to FIG. 9C-(a), whendetecting an operation (for example, a touch and hold operation) on themark of the clip 3, the mobile phone displays a button “Rerecord”. Whendetecting an operation of tapping the button “Rerecord”, the mobilephone displays an interface shown in FIG. 9C-(c). The interface is usedto rerecord the clip 3. Therefore, only the mark 704 of the third cameramovement mode may be displayed on the interface, and the mark of thefirst camera movement mode and the mark of the second camera movementmode are not displayed. For example, still referring to FIG. 9C-(c),when detecting an operation of tapping the button 705, the mobile phonestarts recording in the third camera movement mode. When the recordingduration (for example, 3 s) is reached, the mobile phone automaticallyreturns to the interface shown in FIG. 8C. The clip 3 is a rerecordedclip.

Optionally, before synthesizing the clip 1 to the clip 3 into the video,the mobile phone may further add a locally recorded video clip. In thiscase, the clip 1 to the clip 3 and the added local video are synthesizedduring video synthesizing. For example, referring to FIG. 9D-(a), abutton “+” is displayed on the effect presentation interface. Whendetecting an operation of tapping the button “+”, the mobile phonedisplays an interface shown in FIG. 9D-(b). The interface is aninterface of “Gallery” of the mobile phone. Assuming that the userselects a video 913, when the mobile phone detects an operation oftapping a button “Add”, the mobile phone displays an interface shown inFIG. 9D-(c), where a clip 4, that is, the video 913, is added to theinterface. In this case, if the mobile phone detects an operation oftapping the button “OK”, the mobile phone synthesizes the four clipsinto a video.

Optionally, the mobile phone may further perform processing such asclipping and text or music adding on a recorded video clip.

For example, referring to FIG. 9E-(a), four icons are displayed in thepreview box 901: a clipping icon, a text icon, a music icon, and a muteicon. It can be understood that the four icons act on the clip 1 whenthe clip 1 is played in the preview box, and the four icons act on theclip 2 when the clip 2 is played in the preview box.

For example, the clip 1 is displayed in the preview box. When detectingan operation on the clipping icon, the mobile phone may display aninterface shown in FIG. 9E-(b). A clipping box 910 is displayed in thepreview box 901, and all frames of images of the clip 1 may be displayedin the clipping box 910. For example, when the user wants to clip thelast several frames, the user may move a clipping strip 911 to aposition shown in FIG. 9E-(b). In this case, the last several frames areclipped. When it is detected that a button “OK” is tapped, an interfaceshown in FIG. 9E-(a) may be returned. In this case, a clipped clip 1 isdisplayed in the preview box 901.

When detecting an operation on the text icon, the mobile phone displaysan interface shown in FIG. 9E-(c). A text input box is displayed in thepreview box 901 on the interface, and the user may enter a text in thetext input box. When it is detected that the button “OK” is tapped, theinterface shown in FIG. 9E-(a) is returned. In this case, a clip 1obtained after text adding is displayed in the preview box 901. Itshould be noted that text adding is used as an example for descriptionherein. It can be understood that an emoticon, an animation, and thelike may also be added.

When detecting an operation on the music icon, the mobile phone maydisplay an interface shown in FIG. 9E-(d). A song clip list is displayedon the interface, and the list includes marks of a plurality of songclips such as a mark of a song clip A and a mark of a song clip B. Whenthe mobile phone detects that the user selects the mark of the song clipA, the mobile phone may use the song clip A as background music of theclip 1. For example, when detecting that the button “OK” is tapped, themobile phone returns to the interface shown in FIG. 9E-(a). In thiscase, a clip 1 obtained after the song clip A is added is displayed inthe preview box 901. Optionally, in addition to a camera movement mode,a story template may further include default music. For example, for thetravel template, default music of the travel template is music used inthe sample video corresponding to the travel template. Therefore,assuming that the user does not select music, the mobile phone uses thedefault music of the travel template as the background music of thevideo. Because of a music rhythm, an image play rhythm in a video may beconsistent with a music play rhythm. For example, if music includes adrum point, a frame of image is played when one drum point is played,and a next frame of image is played when a next drum point is played.

Optionally, the mobile phone may further eliminate an original sound ina video clip in the three recorded video clips. The original sound maybe understood as a sound in a recorded video. For example, referring toFIG. 9E-(a), when detecting an operation on the mute icon, the mobilephone eliminates an original sound of the clip 1. Optionally, anoriginal sound of a video clip may be entirely or partially eliminated.The clip 1 is used as an example. When the mobile phone detects anoperation on the mute icon, the mobile phone may display an audioclipping box that is similar to, for example, the clipping box 910 inFIG. 9E-(b), and the user may select a to-be-muted part in the clip 1 byusing the audio clipping box, so that an original sound of an unmutedpart in the clip 1 is retained.

It should be noted that FIG. 9E-(a) to FIG. 9E-(d) only list fourprocessing manners of performing clipping, text adding, music adding,and original sound elimination on a video clip. It can be understoodthat another processing manner may be further included. For example,various picture styles may be further provided to process an image in aclip, for example, a black-and-white style, an animation style, an inkand wash style, a strong exposure style, and a weak exposure style,which are not enumerated one by one in this application.

Optionally, the mobile phone may further select a synthesis specialeffect, and the synthesis special effect is used to synthesize threevideo clips in a specific synthesizing manner. For example, referring toFIG. 9F-(a), when detecting an operation on a button “Animation”, themobile phone displays an interface shown in FIG. 9F-(b). The interfaceincludes a plurality of synthesis special effects. For example, assumingthat the user selects “Combine”, when the mobile phone detects anoperation that the user taps a button “OK”, a manner of synthesizing theclip 1 and the clip 2 is: fusing the last frame of the clip 1 and thefirst frame of the clip 2; and a corresponding synthesis effect is asfollows: After playing the last second frame of the clip 1, the mobilephone plays the last frame of the clip 1, where the last frame is animage obtained by fusing the last frame of the clip 1 and the firstframe of the clip 2; and then continues to play the second frame of theclip 2. To help the user view a synthesis effect, the mobile phonedisplays an interface shown in FIG. 9F-(c), to display the synthesiseffect. When detecting that a button “Save” is tapped, the mobile phonesaves the synthesis effect “Combine”, and then returns to an interfaceshown in FIG. 9F-(a). When detecting an operation of tapping a button“OK” on the interface, the mobile phone synthesizes the clip 1 and theclip 3 by using the saved synthesis special effect.

FIG. 9F-(b) is used as another example. Assuming that the user selects“Gradually zoom in”, a corresponding synthesis effect is as follows:After playing the clip 1, the mobile phone plays the first frame ofimage in the clip 2 in a gradually zoom-in manner, and then plays thesecond frame of image in the clip 2. It should be noted that “Combine”,“Gradually zoom in”, and the like are used as examples for descriptionherein. There may be other synthesis special effects, which are notenumerated one by one in this application.

Optionally, when storing a video, the mobile phone may store both anoriginal video and a synthetic video. FIG. 9B-(a) is used as an example.When detecting the button “OK”, the mobile phone may store the videoobtained by synthesizing the clip 1 to the clip 3, or may store anoriginal video, where the original video may be understood as a videorecorded without a camera movement mode. For ease of understanding, therightward movement shown in FIG. 3A-(a) is used as an example. Anoriginal video is a video constituted by the m^(th) frame of image tothe (m+3)^(th) frame of image instead of a video constituted by imageblocks in the m^(th) region to the (m+1)^(th) region. For example, FIG.10 shows an interface of a gallery application in the mobile phone. Theinterface stores two videos: a video shot in a camera movement mode anda video shot without a camera movement mode. For ease of distinguishingby the user, a mark 1001 may be displayed on the video shot in a cameramovement mode. Optionally, when detecting the button “OK”, the mobilephone may alternatively store each of the clip 1 to the clip 3.

In the foregoing embodiment. FIG. 6(a) is used as an example. Aplurality of story templates are provided on the home page of the micromovie mode. The plurality of story templates are set by default (forexample, are set when the mobile phone is delivered from a factory). Itcan be understood that the user may alternatively customize a storytemplate. For ease of distinguishing, templates that are set by defaultare collectively referred to as a “default template”, and templates thatare customized by the user are collectively referred to as a“user-defined template”.

For example, referring to FIG. 11A-(a), a button “+” may be furtherdisplayed on the home page. When detecting an operation on the button,the mobile phone may display an interface shown in FIG. 11A-(b). Theinterface is the interface of “Gallery” in the mobile phone. The usermay select a video clip stored in “Gallery”. Assuming that the userselects a clip 1101, when the mobile phone detects that the user taps abutton “Add”, the mobile phone displays an interface shown in FIG.11A-(c). A new template is added to the interface. The user may set aname of the new template. For example, referring to FIG. 11B, whendetecting an operation (for example, a touch and hold operation) on thenew template, the mobile phone displays a button “Name”; and whendetecting an operation of tapping the button “Name”, the mobile phonenames the new template.

After adding a user-defined template, the mobile phone may parse acamera movement mode corresponding to the template. When the userselects a customized module, the user shoots a video in a cameramovement mode corresponding to the customized module, to be specific,the user may use the template to shoot a video with an effect similar tothat of the template. For example, if the user captures a clip from amovie as a user-defined template, an effect of a video shot by the userby using the template may be similar to that of the movie. Therefore,for non-professional photographers, shooting works with relatively highquality may also be obtained, and user experience is relatively good.

It can be understood that a template that the user does not like or thatis not frequently used may be deleted. Both a default template and auser-defined template can be deleted; or only a user-defined templatecan be deleted, and a default template cannot be deleted. For example,referring to FIG. 11B, when detecting an operation (for example, a touchand hold operation) on the new template, the mobile phone displays abutton “Delete”; and when detecting an operation of tapping the button“Delete”, the mobile phone deletes the new template.

In FIG. 11A-(b), an example in which a user-defined template is a localvideo of the mobile phone is used. It can be understood that auser-defined module may alternatively be set in another manner. FIG.11A-(a) is used as an example. When detecting an operation on the button“+”, the mobile phone displays an interface shown in FIG. 11C. Theinterface includes a camera movement mode list. The user may select aplurality of camera movement modes from the camera movement mode listand combine the camera movement modes into a user-defined storytemplate. Assuming that the user selects “Rightward move mode”, “Pullmode”, and “Leftward shake mode”, when the mobile phone detects anoperation of tapping a button “Combine”, the mobile phone may displaythe interface shown in FIG. 11A-(c). A newly added template on theinterface includes a plurality of camera movement modes selected by theuser.

With reference to the foregoing embodiment and the related accompanyingdrawings, an embodiment of this application provides a video shootingmethod. As shown in FIG. 12 , the method may include the followingsteps.

S1201; Enable a camera function. For example, a mobile phone detects anoperation used to open a camera application, and starts the cameraapplication. The operation may be an operation of tapping the icon of“Camera” in FIG. 4(a). Certainly, the operation may alternatively beanother operation, provided that the camera application can be opened.An operation type is not limited in this embodiment of this application.

S1202: Determine a first video recording template in response to a firstoperation of a user, where the first video recording template includes afirst example sample, a second example sample, and preset audio, thefirst example sample corresponds to a first camera movement mode, thesecond example sample corresponds to a second camera movement mode, andthe first camera movement mode is different from the second cameramovement mode.

The first video recording template may be, for example, the traveltemplate or the quiet template in FIG. 7A. Certainly, the first videorecording template may alternatively be a default template, or may be auser-defined template, as shown in FIG. 11A.

The first operation may be one or more operations. It is assumed thatthe first operation is one operation. For example, after starting thecamera application, the mobile phone displays the viewfinder interfaceshown in FIG. 4(b). The first operation may be an operation of tapping abutton of the first video recording template, an operation of indicatingthe first video recording template through a voice, or the like. This isnot limited in this embodiment of this application. It is assumed thatthe first operation includes a plurality of operations. For example, thefirst operation includes an operation of tapping the icon of “Micromovie” in FIG. 5A-(a) to FIG. 5A-(c), an operation of tapping the traveltemplate in FIG. 6(a), and an operation of tapping the control 603.

For the first example sample (or referred to as a first video sample),the second example sample (or referred to as a second video sample), andthe preset audio, refer to the foregoing descriptions.

S1203: Display a video recording interface, where the video recordinginterface includes a first camera movement mode identifier and a secondcamera movement mode identifier.

For example, if the first video recording template is the traveltemplate, the video recording interface may be the interface shown inFIG. 7A.

S1204: Keep a position of the electronic device unchanged and startvideo recording in response to a second operation of the user.

Manner 1 is as follows: Video recording starts in response to anoperation (that is, the second operation) of tapping a recording button(for example, the button 705 in FIG. 7A). Specifically, a first videoclip is first recorded in the first camera movement mode, and a secondvideo clip is automatically recorded in the second camera movement modeafter the recording is completed. Manner 2 is as follows: When the firstcamera movement mode identifier is selected, the first video clip isgenerated in the first camera movement mode in response to a shootingindication by the user, where duration of the first video clip is firstpreset duration; and when the second camera movement mode identifier isselected, the second video clip is generated in the second cameramovement mode in response to a shooting indication by the user, whereduration of the second video clip is second preset duration. In otherwords, for each camera movement mode, the user may control start and/orstop of recording.

S1205: Automatically generate a synthetic video, where the syntheticvideo includes the first video clip, the second video clip, and thepreset audio, the first video clip is a video clip generated by theelectronic device in the first camera movement mode, and the secondvideo clip is a video clip generated by the electronic device in thesecond camera movement mode.

One manner is as follows: Video recording starts in response to anoperation (that is, the second operation) of tapping a recording button(for example, the button 705 in FIG. 7A), where the recording manner maybe Manner 1 or Manner 2; and video synthesizing may be automaticallyperformed after the second video clip is recorded. Alternatively,another manner is as follows: Before the synthetic video isautomatically generated, a presentation interface is displayed, wherethe presentation interface includes the first video clip and the secondvideo clip; and video synthesizing is performed in response to a videosynthesizing instruction entered by the user.

Optionally, when the first video clip is generated in the first cameramovement mode, a countdown of generating the first video clip in thefirst camera movement mode is further displayed on the video recordinginterface; and when the second video clip is generated in the secondcamera movement mode, a countdown of generating the second video clip inthe second camera movement mode is further displayed on the videorecording interface. For example, refer to FIG. 7B-(a) to FIG. 7B-(c),FIG. 7C-(a) to FIG. 7C-(c), and FIG. 7D-(a) to FIG. 7D-(c).

Optionally, the user may further delete a camera movement modeidentifier. For example, the mobile phone displays the video recordinginterface, where the video recording interface includes the first cameramovement mode identifier and the second camera movement mode identifier;deletes the first camera movement mode identifier or the second cameramovement mode identifier in response to a third operation of the user;keeps the position of the electronic device unchanged and startsrecording in response to a fourth operation of the user; and

automatically generates a synthetic video, where the synthetic videoincludes a video clip generated by the electronic device in a cameramovement mode that is not deleted and the preset audio. For example, ifthe first camera movement mode identifier is deleted, the first cameramovement mode is deleted. In this case, the electronic device startsrecording, only needs to generate the second video clip in the secondcamera movement mode, and does not need to perform video synthesizing byusing another video clip.

Optionally, the user may further add a camera movement mode identifier.For example, the electronic device displays the video recordinginterface, where the video recording interface includes the first cameramovement mode identifier and the second camera movement mode identifier;adds a third camera movement mode identifier to the video recordinginterface in response to a third operation of the user, where the thirdcamera movement mode identifier is used to indicate a third cameramovement mode; keeps the position of the electronic device unchanged andstarts recording in response to a fourth operation of the user; andautomatically generates a synthetic video, where the synthetic videoincludes the first video clip, the second video clip, a third videoclip, and the preset audio, and the third video clip is a video clipgenerated by the electronic device in the third camera movement mode.

Optionally, the user may further adjust an order of camera movement modeidentifiers. For example, the electronic device displays the videorecording interface, where the video recording interface includes thefirst camera movement mode identifier and the second camera movementmode identifier; adjusts an order of displaying the first cameramovement mode identifier and the second camera movement mode identifierto a first order in response to a third operation of the user; keeps theposition of the electronic device unchanged and starts recording inresponse to a fourth operation of the user; and automatically generatesa synthetic video, where an order of playing the first video clip andthe second video clip in the synthetic video is the first order.

Optionally, the first example sample and/or the second example sampleare/is displayed on the video recording interface. For example, therecording interface may be the interface in FIG. 8D-(b), and an exampleclip may be displayed on the viewfinder interface in apicture-in-picture manner. For details, refer to the foregoingdescriptions in FIG. 8D-(b).

Optionally, the electronic device may further delete the first videoclip or the second video clip in response to the fourth operation: oradd a local third video clip to the synthetic video: or adjust the orderof playing the first video clip or the second video clip in thesynthetic video. For example, refer to the foregoing descriptions inFIG. 9C-(a) to FIG. 9C-(c).

Optionally, the first video recording template is a default template ora user-defined template. For example, refer to FIG. 11A-(a) to FIG.11A-(c).

Optionally, the electronic device may further automatically store thefirst video clip, the second video clip, and the synthetic video. Forexample, refer to the foregoing descriptions in FIG. 10 .

Optionally, in response to a specific operation, the electronic devicemay further change audio in the synthetic video, or add a text and/or apicture to the synthetic video. For details, refer to the foregoingdescriptions in FIG. 9E-(a) to FIG. 9E-(d).

Embodiment 2

In Embodiment 1 above, a combination of a plurality of camera movementmodes is implemented in a micro movie mode. Different from Embodiment 1,Embodiment 2 provides another video shooting manner, that is, a mannerin which a mobile phone performs shooting in a specific camera movementmode.

FIG. 13(a) shows a graphical user interface (graphical user interface,GUI) of the mobile phone. The GUI is a home screen 401 of the mobilephone. After detecting an operation that a user taps an icon 402 of acamera application on the home screen 401, the mobile phone may startthe camera application, start a common wide-angle camera (for example, arear-facing camera), and display another GUI shown in FIG. 13(b), wherethe GUI may be referred to as a viewfinder interface 1303. Theviewfinder interface 1303 is a viewfinder interface in a video recordingmode (a common video recording mode). It should be understood that, ifthe mobile phone detects an operation that the user taps the icon 1302,the mobile phone displays a viewfinder interface of a photo mode bydefault, the user may select a video recording mode by performing aninput operation such as a flick operation in a region 1304 (a region ina dashed box) in FIG. 13(b), and then the phone displays a viewfinderinterface in the video recording mode.

For example, referring to FIG. 13(b), after the mobile phone enters thevideo recording mode, the viewfinder interface 1303 includes a previewimage. The viewfinder interface 1303 may further include a control 1305used to indicate a beauty mode, a control 1306 used to indicate a beautylevel, and a video recording control 1307. In the video recording mode,after the mobile phone detects an operation that the user taps the videorecording control 1307, the mobile phone starts video recording.

It can be understood that the mobile phone performs different videostream processing procedures for a “shake” shooting manner and a “move”shooting manner. Therefore, this embodiment of this application providesa plurality of recording modes, for example, a common video recordingmode and two camera movement modes (for example, including a move modeand a shake mode). The user may indicate the mobile phone to use aspecific camera movement mode. The mobile phone performs differentprocessing processes in different camera movement modes. For example,when the user expects to use the “shake” shooting manner, the user mayenter an instruction to indicate the mobile phone to enter the shakemode. If the user expects to use the “move” shooting manner, the usermay enter another instruction to indicate the mobile phone to enter themove mode. That the mobile phone enters the shake mode may be understoodas that the mobile phone performs processing based on a processingprocedure corresponding to the move mode. That the mobile phone entersthe move mode may be understood as that the mobile phone performsprocessing based on a processing procedure corresponding to the shakemode.

In some embodiments, the mobile phone starts the camera application,enters the common video recording mode by default, and enters acorresponding camera movement mode after the user indicates the cameramovement mode. Alternatively, after starting the camera application, themobile phone enters a camera movement mode by default, for example, acamera movement mode used when the camera application is used last time.Assuming that the mobile phone enters the move mode by default afterstarting the camera application, the mobile phone may start anultra-wide-angle camera. An image block on an image captured by theultra-wide-angle camera is displayed on the viewfinder interface, forexample, may be displayed at a central position.

The user may indicate the shake mode and the move mode in a plurality ofmanners, including but not limited to Manner 1 and Manner 2 below.

Manner 1: Referring to FIG. 14(a), the mobile phone is currently in acommon video recording mode. A control 1308 used to indicate a cameramovement mode is displayed on the viewfinder interface 1303. Whendetecting an operation on the control 1308 used to indicate a cameramovement mode, the mobile phone displays a GUI shown in FIG. 14(b). Aselection box 1309 is displayed on the GUI. The selection box 1309includes options “Shake mode” and “Move mode”. When detecting anoperation on “Move mode” in the selection box 1309, the mobile phoneenters the move mode. When detecting “Shake mode”, the mobile phoneenters the shake mode.

For example, after the mobile phone enters the common video recordingmode, the control 1308 used to indicate a camera movement mode isdisplayed on the viewfinder interface by default; or after the user setsa camera movement mode shortcut, the control 1308 used to indicate acamera movement mode is displayed on the viewfinder interface. The usermay set the camera movement mode shortcut by using a setting menu or thelike in the camera application.

It should be noted that a display position of the control 1308 used toindicate a camera movement mode on the viewfinder interface 1303 is notlimited in this embodiment of this application, or the user maycustomize a display position of the control 1308, or a display positionof the control 1308 may be adaptively adjusted according to a landscapemode or a portrait mode of the mobile phone. In addition, the control1308 used to indicate a camera movement mode may be in a form in which apreview image is not blocked as much as possible, for example, atransparent or translucent form.

It should be understood that, in Manner 1, the control 1308 used toindicate a camera movement mode is intuitively presented on theviewfinder interface, so that a user operation is convenient, and userexperience is relatively good.

Manner 2: Referring to FIG. 15(a), the mobile phone is currently in acommon video recording mode. The viewfinder interface 1303 furtherincludes a control “More” 1310. When detecting an operation used toselect the control “More” 1310, the mobile phone displays another GUIshown in FIG. 15(b). Icons corresponding to a plurality of photo modesare displayed on the GUI, including an icon of “Shake mode” and an iconof “Move mode”. When detecting an operation on the icon of “Move mode”,the mobile phone enters the move mode. When detecting an operation onthe icon of “Shake mode”, the mobile phone enters the shake mode. Itshould be understood that, in Manner 2, the control 1308 used toindicate a camera movement mode may not be displayed on the viewfinderinterface, so that a preview image on the viewfinder interface can beprevented from being blocked.

It can be understood that Manner 1 and Manner 2 above are merelyexamples, and another manner of indicating the mobile phone to enter acamera movement mode (the shake mode or the move mode) is also feasible.For example, a voice instruction is used to indicate the mobile phone toenter the shake mode or the move mode. This is not limited in thisembodiment of this application. The following uses Manner 1 as anexample for description.

Embodiment 1

For example, FIG. 16 is a schematic diagram of a GUI displayed when themobile phone enters the move mode. To help the user determine a currentmode, when the mobile phone enters the move mode, the mobile phone maydisplay prompt information 1312 on the viewfinder interface. The promptinformation 1312 is used to indicate that the mobile phone is currentlyin the move mode. Certainly, when the mobile phone switches from thecommon video recording mode to the move mode, the mobile phone may alsooutput another prompt, for example, a vibration feedback. The promptinformation 1312 may be displayed in a manner in which a preview imageis not blocked as much as possible, for example, a translucent manner ora transparent manner. A direction control 1311 is also displayed on theviewfinder interface. The user may enter, by using the direction control1311, information used to indicate an image movement direction. Itshould be understood that a display position of the direction control1311 on the viewfinder interface is not limited in this embodiment ofthis application. For example, the direction control 1311 is displayedat a position shown in FIG. 16 by default, or the user may adjust thedisplay position of the direction control 1311.

In some embodiments, the mobile phone uses a first wide-angle camera(for example, a common wide-angle camera) in the common video recordingmode. When switching from the common video recording mode to the movemode, the mobile phone starts a second wide-angle camera (for example,an ultra-wide-angle camera). An angle of view of the first wide-anglecamera is less than an angle of view of the second wide-angle camera. Afirst preview image is displayed on the viewfinder interface in the movemode. The first preview image is a first image block in a first regionon an image captured by the ultra-wide-angle camera. It can beunderstood that the mobile phone starts the ultra-wide-angle cameraafter entering the move mode. In this case, the first preview image maybe a first image block in a first region on a first frame of imagecaptured by the ultra-wide-angle camera.

The first image block may be an image block that corresponds to thefirst preview image and that is on the image captured by theultra-wide-angle camera. For example, the first image block is all or apart of an image in an overlapping angle of view range between the imagecaptured by the ultra-wide-angle camera and an image captured by acommon wide-angle camera. FIG. 17 is a schematic diagram of the firstregion on the image captured by the ultra-wide-angle camera. The firstregion may be all or a part of an overlapping angle of view rangebetween the ultra-wide-angle camera and the common wide-angle camera. Itcan be learned from FIG. 17 and FIG. 18 through comparison that thepreview image is the first image block in the first region in FIG. 18after the mobile phone enters the move mode in FIG. 17 . The mobilephone may close or open the common wide-angle camera after switchingfrom the common video recording mode to the move mode.

In some embodiments, the preview image does not change when the mobilephone switches from the common video recording mode to the move mode.That the preview image does not change may be understood as that thepreview image is not de-magnified or magnified after the mobile phoneswitches to the move mode. For example, a magnification of a previewimage in the move mode and a magnification of a preview image in thecommon video recording mode are the same, for example, both are 1×.Therefore, after the mobile phone switches from the common videorecording mode to the move mode, the user does not perceive that thepreview image is suddenly magnified or de-magnified.

In some other embodiments, the preview image may change m the commonvideo recording mode and the move mode. That the preview image changesmay be understood as that the preview image is de-magnified or magnifiedafter the mobile phone switches to the move mode. For example, amagnification of a preview image in the common video recording mode isIX, and a magnification of a preview image in the move mode is 5×. To bespecific, the preview image is magnified when the mobile phone switchesfrom the common video recording mode to the move mode. It can beunderstood that a position movement range in the first region on theimage captured by the ultra-wide-angle camera is widened in a case inwhich an image magnification is increased after the mobile phoneswitches to the move mode. This can achieve a shooting effect of movinga lens within a relatively wide range.

The following embodiment describes a process in which the mobile phoneimplements image translation in the move mode.

Referring to FIG. 18 , the ultra-wide-angle camera captures N frames ofimages, for example, a first frame of image, a second frame of image,and an (m−1)^(th) frame of image. It can be understood that the mobilephone starts the ultra-wide-angle camera after entering the move mode.In this case, the first preview image displayed after the mobile phoneenters the move mode may be a first image block in a first region on afirst frame of image captured by the ultra-wide-angle camera. Assumingthat the mobile phone has not detected an image movement instruction,the mobile phone determines a second region on the second frame ofimage. A position of the second region does not move relative to that ofthe first region, and the preview image is updated from the image blockin the first region to an image block in the second region. By analogy,a position of an (m−1)^(th) region on the (m−1)^(th) frame of image doesnot move relative to that of the first region, where m may be an integergreater than or equal to 3. The preview image is updated to an imageblock in the (m−1)^(th) region. In other words, the mobile phone doesnot detect the image movement instruction in a period from the firstframe of image to the (m−1)^(th) frame of image. Therefore, a positionof the preview image on the image does not change.

Assuming that the mobile phone detects an image rightward movementinstruction before the preview image is updated to an image block in anm^(th) region on an m^(th) frame of image (for example, in a process inwhich the preview image is displayed as the image block in the(m−1)^(th) region), the mobile phone determines the m^(th) region on them^(th) frame of image, where a position of the m^(th) region movesrightward by a distance A relative to that of the (m−1)^(th) region. Asshown in FIG. 18 , a distance between the (m−1)^(th) region and a leftimage edge is H, and a distance between the m^(th) region and a leftimage edge is H+A. In this case, after the mobile phone detects theimage rightward movement instruction, the preview image on theviewfinder interface is updated from the image block in the (m−1)^(th)region to the image block in the m^(th) region, to be specific, thepreview image moves rightward by a distance A on the image.

Then, the mobile phone determines an (m+1)^(th) region on an (m+1)^(th)frame of image, where a position of the (m+1)^(th) region movesrightward by a distance B relative to that of the m^(th) region. Asshown in FIG. 18 , the distance between the m^(th) region and the leftimage edge is H+A, and a distance between the (m+1)^(th) region and aleft image edge is H+A+B. In this case, the preview image on theviewfinder interface is updated from the image block in the m^(th)region to an image block in the (m+1)^(th) region, to be specific, thepreview image moves rightward by a distance B on the image.

The mobile phone determines an (m+2)^(th) region on an (m+2)^(th) frameof image, where a position of the (m+2)^(th) region moves rightward by adistance C relative to that of the (m+1)^(th) region. As shown in FIG.18 , the distance between the (m+1)^(th) region and the left image edgeis H+A+B, and a distance between the (m+2)^(th) region and a left imageedge is H+A+B+C. In this case, the preview image on the viewfinderinterface is updated from the image block in the (m+1)^(th) region to animage block in the (m+2)^(th) region, to be specific, the position ofthe preview image on the image moves rightward by a distance C.Therefore, the preview image gradually moves rightward on the image.

Assuming that the mobile phone detects a movement stop instruction, themobile phone determines an (m+3)^(th) region on an (m+3)^(th) frame ofimage, where a position of the (m+3)^(th) region does not changerelative to that of the (m+2)^(th) region. The preview image is updatedfrom the image block in the (m+2)^(th) region to an image block in the(m+3)^(th) region, to be specific, the position of the preview image onthe image does not change. In this case, the rightward movement stops.Then, the preview image is updated from the image block in the(m+3)^(th) region to an image block in an (m+4)^(th) region, to bespecific, the position of the preview image on the image remainsunchanged until the image movement instruction is detected again and themovement continues.

There are a plurality of value relationships among A, B, and C. Thefollowing provides several examples.

Example 1: A=B=C. It is assumed that A=B=C=L. To be specific, after themobile phone detects the image rightward movement instruction, aposition of a target region (for example, the m^(th) region, the(m+1)^(th) region, and the (m+2)^(th) region in FIG. 18 ) on each frameof image moves rightward by a same distance L, to be specific, movesrightward at a constant speed relative to that of a target region on aprevious frame of image. In this case, the constant rightward movementis performed. In other words, after the mobile phone detects the imagerightward movement instruction, the position of each updated previewimage on the image relative to the previous frame of preview image movesrightward by the same distance L, until the movement stop instruction isdetected. This achieves a shooting effect of the constant rightwardmovement.

Example 2: A<B<C<D. It is assumed that A=L, B=2L, and C=3L. To bespecific, after the mobile phone detects the image rightward movementinstruction, a target region on a next frame of image moves rightward atan accelerated speed relative to a target region on a previous frame ofimage. For example, the m^(th) region moves rightward by a distance Lrelative to the (m−1)^(th) region; the (m+1)^(th) region moves rightwardby a distance 2L relative to the m^(th) region, to be specific, the(m+1)^(th) region moves rightward at an accelerated speed; and the(m+2)^(th) region moves rightward by a distance 3L relative to the(m+1)^(th) region, to be specific, the (m+2)^(th) region moves rightwardat an accelerated speed relative to the (m+1)^(th) region. Therefore,after the mobile phone detects the image rightward movement instruction,each updated preview image moves rightward at an accelerated speedrelative to a previous frame of preview image. This achieves a shootingeffect of an accelerated image rightward movement.

Example 3: A>B>C>D. It is assumed that A=2L, B=L, and C=0. To bespecific, after the mobile phone detects the image rightward movementinstruction, a target region on a next frame of image moves rightward ata decelerated speed relative to a target region on a previous frame ofimage. For example, the m^(th) region moves rightward by a distance 2Lrelative to the (m−1)^(th) region: the (m+1)^(th) region moves rightwardby a distance L relative to the m^(th) region, to be specific, the(m+1)^(th) region moves rightward at a decelerated speed relative to them^(th) region; and the (m+2)^(th) region moves rightward by a distance 0relative to the (m+1)^(th) region, to be specific, the (m+2)^(th) regionmoves rightward at a decelerated speed relative to the (m+1)^(th)region. In this case, the movement stops. Therefore, after the mobilephone detects the image rightward movement instruction, each updatedpreview image moves rightward at a decelerated speed relative to aprevious frame of preview image, even the speed decreases to 0. Thisachieves a shooting effect of a decelerated image rightward movement.

The foregoing provides three examples of the value relationship among A,B, and C. The values of A, B, and C are not limited in this embodimentof this application, and may be flexibly set by a person skilled in theart to achieve different technical effects.

In some embodiments, after the mobile phone detects an instruction usedto indicate an image movement direction, a manner in Example 1, Example2, or Example 3 is used by default. Alternatively, after the mobilephone detects an instruction used to indicate an image movementdirection, a manner in Example 1 is used by default; when the mobilephone detects an accelerated movement instruction, a manner in Example 2is used; and when the mobile phone detects a decelerated movementinstruction, a manner in Example 3 is used.

First Manner:

The ultra-wide-angle camera captures images frame by frame. It isassumed that N frames of images are captured, and preview images aresequentially updated to image blocks in target regions on the N framesof images. It can also be understood that the mobile phone does notperform frame extraction or frame insertion processing on the N framesof images captured by the ultra-wide-angle camera, but sequentiallyupdates the preview images to the image blocks in the target regions onthe N frames of images. This helps improve continuity and smoothness ofpreview images. Assuming that the mobile phone determines the targetregion in the manner in which A=B=C=L in FIG. 18 after detecting theinstruction used to indicate the image movement direction, the positionof the preview image on the image moves rightward at a constant speed.Assuming that the mobile phone determines the target region in themanner in which A<B<C<D in FIG. 18 , the position of the preview imageon the image moves rightward at an accelerated speed. Assuming that themobile phone determines the target region in the manner in whichA>B>C>D, the position of the preview image on the image moves rightwardat a decelerated speed.

Second Manner:

The ultra-wide-angle camera captures N frames of images. The mobilephone extracts M frames of images from the N frames of images capturedby the ultra-wide-angle camera, where M is an integer less than N; andupdates a preview image by using an image block in a target region oneach of the M frames of images. This can achieve a fast update (or play)effect. For example, it is assumed that an image capture frame rate ofthe ultra-wide-angle camera is 240 fps, to be specific, 240 frames ofimages are captured per second. It is further assumed that an image play(or referred to as update) frame rate of the mobile phone is 30 fps, tobe specific, updating is performed by 30 frames per second. In thiscase, the 240 frames of images need to be updated in 8 seconds. Assumingthat the mobile phone extracts 120 frames of images from the 240 framesof images, the extracted 120 frames are updated in only 4 seconds. Thisachieves a fast update effect.

Example 1: Referring to FIG. 19A, the ultra-wide-angle camera captures Nframes of images, for example, sequentially captures a first frame ofimage, a second frame of image, and an (m−1)^(th) frame of image.Assuming that the mobile phone detects an image rightward movementinstruction before a preview image is updated to an m^(th) region on anm frame of image, the mobile phone determines a target region on them^(th) frame of image in the N frames of images and a target region oneach subsequent frame of image. It is assumed that a position of atarget region on a next frame of image moves rightward by a samedistance L (in other words, in the foregoing manner in which A=B=C=L)relative to that of a target region on a previous frame of image.

Then, the mobile phone starts frame extraction. It is assumed that theframe extraction starts from the m^(th) frame, and the m^(th) frame, an(m+i)^(th) frame, and an (m+i+j)^(th) frame are extracted. The m^(th)region on the m^(th) frame moves rightward by a distance L relative tothe (m−1)^(th) frame, an (m+i)^(th) region on the (m+i)^(th) frame ofimage moves rightward by a distance i L relative to the m^(th) frame,and an (m+i+j)^(th) region on the (m+i+j)^(th) frame of image movesrightward by a distance j L relative to the (m+i)^(th) frame.

Still referring to FIG. 19A, assuming that the mobile phone detects animage movement stop instruction in a process in which the preview imageis displayed as an image block in the (m+i+j)^(th) region, the mobilephone continues to update the preview image by using an image block inthe target region on the (m+i+j+1)^(th) frame of image, an image blockin the target region on the (m+i+j+2)^(th) frame of image, and the like.To be specific, after the mobile phone detects the image movement stopinstruction, updating is performed without performing frame extraction,and a position of the target region on the image such as the(m+i+j+1)^(th) frame of image or the (m+i+j+2)^(th) frame of imagerelative to the (m+i+j)^(th) region on the image remains unchanged, inother words, does not move. In other words, after the mobile phonedetects an instruction used to indicate an image movement direction, thepreview image is updated through frame extraction, and the position ofthe preview image on the image gradually moves in the image movementdirection. After the mobile phone detects the image movement stopinstruction, processing through frame extraction is not performed, andthe position of the preview image on the image does not move.

FIG. 19A is still used as an example. Values of i and j may beunderstood as frame extraction intervals, and different values of i andj achieve different shooting effects.

It is assumed that i=j, which may be understood as that frame extractionintervals are the same. For example, i=j=2, to be specific, one frame isextracted every other frame or one frame is extracted every two frames.To be specific, after the mobile phone detects the image rightwardmovement instruction, preview images are sequentially updated to animage block in the m^(th) region, an image block in an (m+2)^(th)region, an image block in an (m+4)^(th) region, and the like. The m^(th)region moves rightward by 2L relative to the (m+2)^(th) region, and the(m+4)^(th) region moves rightward by 2L relative to the (m+2)^(th)region. To be specific, a position of each updated preview image movesrightward by 2L relative to that of a previous frame of preview image onan image. It can be learned through comparison with the case in whichA=B=C=L in FIG. 18 that, in the embodiment shown in FIG. 19A, theposition of the preview image on the image may move rightward relativelyfast at a constant speed (may move rightward by 2L each time) throughframe extraction. In addition, the frame extraction updating can achievea fast update effect. In other words, a position of a preview image onan image moves rightward relatively fast at a constant speed while thepreview image is updated relatively fast.

Certainly, frame extraction intervals may alternatively be different, inother words, i is not equal to j. It is assumed that i<j, for example,i=2, and j=3. To be specific, after the mobile phone detects the imagerightward movement instruction, the preview image is sequentiallyupdated to image blocks in the m^(th) region, the (m+2)^(th) region, an(m+5)^(th) region, and the like. The (m+2)^(th) region moves rightwardby 2L relative to the m^(th) region, and the (m+5)^(th) region movesrightward by 3L relative to the (m+2)^(th) region. Therefore, after themobile phone detects the image rightward movement instruction, aposition of each updated preview image moves rightward at an acceleratedspeed relative to that of a previous frame of preview image on an image.In addition, the frame extraction updating can achieve a fast updateeffect. In other words, a position of a preview image on an image movesrightward at an accelerated speed while the preview image is updatedrelatively fast.

It is assumed that i>j, for example, i=3, and j=2. To be specific, afterthe mobile phone detects the image rightward movement instruction, thepreview image is sequentially updated to image blocks in the m^(th)region, an (m+3)^(th) region, the (m+5)^(th) region, and the like. The(m+3)^(th) region moves rightward by 3L relative to the m^(th) region,and the (m+5)^(th) region moves rightward by 2L relative to the(m+3)^(th) region. Therefore, after the mobile phone detects the imagerightward movement instruction, a position of each updated preview imagemoves rightward at a decelerated speed relative to that of a previousframe of preview image on an image. In addition, the frame extractionupdating can achieve a fast update effect. In other words, a position ofa preview image on an image moves rightward at a decelerated speed whilethe preview image is updated relatively fast.

The foregoing provides three examples of the value relationship betweeni and j. The values i and j are not limited in this embodiment of thisapplication, and may be flexibly set by a person skilled in the art toachieve different technical effects.

Example 2: In Example 1 above, the mobile phone first determines atarget region on each frame of image, and then performs frameextraction. In Example 2, the mobile phone may first perform frameextraction, and then determine a target region on an extracted frame ofimage. Referring to FIG. 19B, assuming that the mobile phone detects animage rightward movement instruction before a preview image is updatedto an m^(th) frame of image, the mobile phone starts frame extractionfrom the m^(th) frame of image, to obtain M frames of images. An imageframe extraction interval is not limited herein. The mobile phonedetermines a target region on each of the M frames of images. For amanner of determining the target region on each of the M frames ofimages, refer to the descriptions in FIG. 18 . Details are not describedherein again. Assuming that the mobile phone determines the targetregion on each of the M frames of images in the manner in which A=B=C=L,because the frame extraction updating can achieve a fast update effect,a position of a preview image on an image moves rightward at a constantspeed while the preview image is updated relatively fast. Assuming thatthe mobile phone determines the target region in the manner in whichA<B<C<D in FIG. 18 , a position of a preview image on an image movesrightward at an accelerated speed while the preview image is updatedrelatively fast. Assuming that the mobile phone determines the targetregion in the manner in which A>B>C>D, a position of a preview image onan image moves rightward at a decelerated speed while the preview imageis updated relatively fast.

It should be noted that FIG. 19A is used as an example. Assuming thatthe mobile phone detects an accelerated image rightward movementinstruction before the preview image is updated to the m^(th) frame ofimage, the preview image is updated in the foregoing first manner, to bespecific, is sequentially updated to image blocks in the m^(th) region,the (m+1)^(th) region, the (m+2)^(th) region, and the like withoutperforming frame extraction. Assuming that the mobile phone detects amovement stop instruction before the preview image is updated to the(m+i+j+1)^(th) frame of image, a video is generated, and the video isobtained by synthesizing image blocks in target regions on imagesextracted from the m^(th) frame to the (m+i+j+1)^(th) frame. Forexample, if the m^(th) region, the (m+i)^(th) frame, and the(m+i+j)^(th) frame are extracted, the video may be a video obtained bysynthesizing image blocks in the m^(th) region, the (m+i)^(th) region,and the (m+i+j)^(th) region. In other words, after the mobile phonedetects the accelerated image rightward movement instruction, thepreview image is updated without performing frame extraction. After themobile phone detects the rightward movement stop instruction, agenerated video may be a video obtained by synthesizing image blocks intarget regions on extracted images. The manner of updating a previewimage without performing frame extraction can reduce a calculationamount and improve efficiency.

Third Manner:

The ultra-wide-angle camera captures N frames of images. The mobilephone inserts a plurality of frames of images into the N frames ofimages to obtain M frames of images, where M is an integer greater thanN, and sequentially updates a preview image by using the M frames ofimages. Because an image quantity increases, a slow update (or play)effect can be achieved. For example, it is assumed that an image captureframe rate of the ultra-wide-angle camera is 240 fps, to be specific,240 frames of images are captured per second. It is further assumed thatan image update (or referred to as play) frame rate of the mobile phoneis 30 fps, to be specific, updating is performed by 30 frames persecond. In this case, the 240 frames of images need to be updated in 8seconds. Assuming that the mobile phone inserts 120 frames of imagesinto the 240 frames of images, the obtained 360 frames of images areupdated in only 12 seconds. This achieves a slow update effect.

Example 1: Referring to FIG. 19C, the ultra-wide-angle camera captures Nframes of images, for example, sequentially captures a first frame ofimage, a second frame of image, and an (m−1)^(th) frame of image.Assuming that the mobile phone detects an image rightward movementinstruction before a preview image is updated to an m^(th) frame ofimage, the mobile phone determines a target region on the m^(th) frameof image and a target region on each subsequent frame of image, and aposition of a target region on a next frame of image moves rightward bya same distance L relative to that of a target region on a previousframe of image.

Then, the mobile phone starts frame insertion. It is assumed that themobile phone inserts a P-frame of image (the inserted image isrepresented by a dashed line) between the m^(th) frame and the(m+1)^(th) frame, and inserts a Q-frame of image between the (m+1)^(th)frame and the (m+2)^(th) frame, where P and Q may be the same ordifferent.

Assuming that P=Q=1, one frame is inserted every other frame. The mobilephone may determine a P^(th) region on a P^(th) frame of image (that is,one frame of image inserted between the m^(th) frame and the (m+1)^(th)frame). The P^(th) region moves rightward by a distance X relative tothe m^(th) region. A value of X is not limited in this embodiment ofthis application. For example, X may range from L to 2L, for example,1.5L. The mobile phone determines a Q^(th) region on a Q^(th) frame ofimage (that is, one frame of image inserted between the (m+1)^(th) frameand the (m+2)^(th) frame). The Q^(th) region moves rightward by Yrelative to the (m+1)^(th) region. A value of Y is not limited in thisembodiment of this application. For example, Y may range from 2L to 3L,for example, 2.5L.

For example, X=1.5L, and Y=2.5L. After the mobile phone detects theimage rightward movement instruction, the preview image is sequentiallyupdated to the m^(th) region, the P^(th) region, the (m+1)^(th) region,the Q^(th) region, and the like. Therefore, each updated preview imagemoves rightward by 0.5L. To be specific, a position of a preview imageon an image moves rightward relatively slowly at a constant speed. Inaddition, the frame insertion updating can achieve an effect that apreview image is updated slowly. To be specific, a position of a previewimage on an image may move rightward relatively slowly at a constantspeed while the preview image is updated relatively slowly.

It can be understood that the values of X and Y are related to an imagerightward movement speed. This is not limited in this embodiment of thisapplication. A value relationship between P and Q may be flexibly set inthe technology in this field, to achieve different effects.

It can be understood that, assuming that the mobile phone detects animage movement stop instruction in a process in which an image block inan (m+2)^(th) region is displayed as a preview image, the mobile phonedetermines an image block in an (m+3)^(th) region on an (m+3)^(th) frameof image, an image block in an (m+4)^(th) region on an (m+4)^(th) frameof image, and the like. To be specific, after the mobile phone detectsthe image movement stop instruction, the mobile phone does not performframe insertion, and the position of the preview image on the image doesnot move.

Example 2: In Example 1 above, the mobile phone first determines atarget region on each frame of image, and then performs frame insertion.In Example 2, the mobile phone may first perform frame insertion, andthen determine a target region. Referring to FIG. 19D, assuming that themobile phone detects an image rightward movement instruction before apreview image is updated to an m^(th) frame of image, the mobile phonestarts frame insertion from the m^(th) frame of image, to obtain Mframes of images. A quantity of image frames inserted between twoadjacent frames of images is not limited herein. An example of insertingone frame between two adjacent frames is used. As shown in FIG. 19D, adashed-line image is an inserted image. For a manner in which the mobilephone determines the target region on each of the M frames of images,refer to the descriptions in FIG. 18 . Details are not described hereinagain. Assuming that the mobile phone determines the target region oneach of the M frames of images in the manner in which A=B=C=L, becausethe frame insertion updating can achieve a slow update effect, aposition of a preview image on an image moves rightward at a constantspeed while the preview image is updated relatively slowly. Assumingthat the mobile phone determines the target region in the manner inwhich A<B<C<D, a position of a preview image on an image moves rightwardat an accelerated speed while the preview image is updated relativelyslowly. Assuming that the mobile phone determines the target region inthe manner in which A>B>C>D, a position of a preview image on an imagemoves rightward at a decelerated speed while the preview image isupdated relatively slowly.

In some embodiments, after the mobile phone detects an instruction usedto indicate an image movement direction, the mobile phone performsprocessing in the foregoing first manner by default, and determines thetarget region in the manner in which A=B=C=L in the foregoing firstmanner by default, to be specific, a position of a preview image on animage moves rightward at a constant speed. When the mobile phone detectsan accelerated movement instruction, the mobile phone may determine thetarget region in the manner in which A<B<C<D in the foregoing firstmanner, or may implement an accelerated movement in the frame insertionmanner in Example 1 in the foregoing second manner. When the mobilephone detects a decelerated movement instruction, the mobile phone maydetermine the target region in the manner in which A>B>C>D in theforegoing first manner, or may implement a decelerated movement in theframe insertion manner in Example 1 in the foregoing third manner.

It should be noted that sides may be aligned in a process in whichpositions of target regions on different frames of images move. FIG. 18is still used as an example. Sides of the first region and the secondregion are aligned. For example, a distance between a bottom side of thefirst region and a bottom side of the first frame of image is the sameas a distance between a bottom side of the second region and a bottomside of the second frame of image, to ensure stable display of a previewimage as much as possible. In some embodiments, jitter occurs in aprocess in which the user holds the mobile phone. To alleviateinstability of the preview image caused by jitter of the user, animplementation is as follows: The mobile phone performs imagestabilization on an image captured by the ultra-wide-angle camera, anddetermines a target region such as a first region, a second region, or athird region on an image obtained after the image stabilization. Theimage stabilization may be image stabilization clipping. Generally, whenthe user jitters, an image in an edge region on a preview image changesrelatively quickly and consequently is unstable, and an image in amiddle region on the preview image changes relatively slightly andtherefore is relatively stable. Therefore, the mobile phone may clip anedge of each frame of image captured by the ultra-wide-angle camera. Aspecific clipping area is not limited in this embodiment of thisapplication. For example, the mobile phone determines a first region ona remaining image obtained after a first frame of image is clipped,determines a second region on a remaining image obtained after a secondframe of image is clipped, determines a third region on a remainingimage obtained after a third frame of image is clipped, and so on.Therefore, the preview image is visually displayed relatively stably.

Another possible implementation is as follows: The mobile phone maydetermine a first region on a first frame of image, and perform imagestabilization clipping on a first image block in the first region. Forexample, an edge of the first image block is clipped, and a remainingimage obtained after the edge of the first image block is clipped isdisplayed as a preview image. Likewise, the mobile phone may determine asecond region on a second frame of image, and perform imagestabilization clipping on a second image block in the second region; andso on. In other words, the mobile phone first determines an image blockin a target region on each frame of image, and then performs imagestabilization clipping.

The foregoing mentions a plurality of manners in which the user entersthe instruction used to indicate the image movement direction. Thisincludes but is not limited to the following several examples.

Example 1: Referring to FIG. 16 , the viewfinder interface furtherincludes the direction control 1311. The direction control 1311 mayinclude four arrows distributed around the video recording control 1307.When the mobile phone detects an operation that the user taps (forexample, taps once) an arrow, the mobile phone starts to move the firstregion in a direction indicated by the arrow. For example, if the usertaps a right arrow, a position of a preview image on an image starts tomove rightward. The movement stops when the mobile phone detects a tapoperation of the user at any position on the viewfinder interface, orthe movement stops when the mobile phone detects the right arrow again,or the movement automatically stops after a specific period of time.

Example 2: Referring to FIG. 16 , when the mobile phone detects thatduration in which the user presses an arrow reaches preset duration, themobile phone starts to move the first region in a direction indicated bythe arrow. The movement stops when the user detects an uplift after thetouch and hold operation.

Example 3: Referring to FIG. 16 , when the mobile phone detects anoperation that the user presses and drags (or flicks) the videorecording control 1307 in a direction, the mobile phone starts to movethe first region in the drag direction indicated by the drag operation.For example, if the user presses and drags the video recording control1307 rightward, the mobile phone moves the first region rightward. Themovement stops when the mobile phone detects an uplift after the dragoperation. When the mobile phone detects that a finger presses the videorecording control 1307 and lifts up at the pressed position, the mobilephone determines that recording starts. When the mobile phone detectsthat the finger presses and drags the video recording control 1307 to aposition that is not pressed, the mobile phone determines a direction ofthe drag operation as the image movement direction, and moves the firstregion in the direction.

Example 4: Referring to FIG. 16 , when the mobile phone detects a flickoperation of the user on the screen (for example, on the preview image),the mobile phone starts to move the first region in a flick direction ofthe flick operation. When the mobile phone detects that the flickoperation stops, the mobile phone stops moving the first region. Thatthe flick operation stops may be understood as that the finger of theuser flicks from a point A to a point B and stays at the point B, or thefinger of the user flicks from a point A to a point B and then lifts up.It should be understood that the direction control 1311 may not bedisplayed on the viewfinder interface in this case.

Example 5: The user enters the image movement direction by using a voiceinstruction. The user may tap any position on the viewfinder interfaceor may use a voice instruction to indicate to stop a movement. It shouldbe understood that the direction control 1311 may not be displayed onthe viewfinder interface in this case.

When the method provided in this embodiment of this application isapplied to a device such as a notebook computer, the image movementdirection may be further entered by using a keyboard, a touchpad, or thelike.

The accelerated movement instruction or the decelerated movementinstruction mentioned above may be obtained in the following manner.

For example, referring to FIG. 16 , an identifier 1320 used to indicatea movement speed is displayed on the viewfinder interface. The movementspeed herein may be understood as a position change amount of a previewimage on an image. A default value of the identifier 1320 is 1×. Herein,1× may be understood as one time of L. In other words, when theidentifier 1320 is 1×, the mobile phone may perform processing in theforegoing manner in which A=B=C=L. When the user taps the identifier1320, a speed adjustment bar 1321 is displayed. For example, a largestspeed provided by the speed adjustment bar 1321 in FIG. 16 is 3×, and asmallest speed is 0.5×. This is not limited in this embodiment of thisapplication. It can be understood that 1×, 2×, 3×, and the like may beunderstood as a multiple of L, to be specific, 3× is three times L, and2× is two times L. The user selects a speed by performing a flickoperation on the speed adjustment bar 1321. Assuming that the userselects the speed 2×, the identifier 1320 displays “2×”, and the mobilephone may perform processing in the manner in which i=j=2 in the manner(the frame extraction manner) shown in FIG. 19A, to achieve an effectthat a position of a preview image on an image moves by 2L each time.Assuming that the user selects the speed 0.5L, the mobile phone mayperform processing in the manner in which P=Q=1 in the manner (the frameinsertion manner) shown in FIG. 19C, to achieve an effect that aposition of a preview image on an image moves by 0.5L each time.

It can be understood that the mobile phone may alternatively set a speedin another manner, for example, by using a volume button. For example,if the mobile phone detects that a volume-up button is triggered, thespeed increases: or if the mobile phone detects that a volume-downbutton is triggered, the speed decreases. It should be noted that a formof setting a movement speed by the mobile phone is not limited in thisembodiment of this application. For example, it is also feasible toprovide three speed level options, namely, a low speed, a medium speed,and a high speed, on the viewfinder interface for the user to select.

For example. FIG. 20(a) to FIG. 20(c) are a schematic diagram of aneffect of a viewfinder interface displayed when a mobile phone is in amove mode according to an embodiment of this application. As shown inFIG. 20(a), a preview image 1 is displayed on the viewfinder interface.The mobile phone remains stationary. When the mobile phone detects anoperation of tapping a down arrow, the mobile phone updates the previewimage 1 to a preview image 2. Referring to FIG. 20(b), a scene includedin the preview image 2 is located below a scene in the preview image 1.This is equivalent to downward movement shooting by the mobile phone.The mobile phone continues to update the preview image 2 to a previewimage 3. Referring to FIG. 20(c), a scene included in the preview image3 is located below the scene in the preview image 2. This is equivalentto downward movement shooting by the mobile phone. Assuming that themobile phone detects that the user taps any position on the screen, themovement ends. It can be learned from FIG. 20(a) to FIG. 20(c) that ascene in a preview image gradually moves downward in a process in whichthe mobile phone remains stationary. This achieves a shooting effect ofmoving a lens downward.

Embodiment 2

For example, FIG. 21 is a schematic diagram of a GUI displayed when themobile phone enters the shake mode. To help the user determine a currentmode, when the mobile phone enters the shake mode, the mobile phone maydisplay prompt information 1313 on the viewfinder interface. The promptinformation 1313 is used to indicate that the mobile phone is currentlyin the shake mode. Certainly, when the mobile phone switches from thecommon video recording mode to the shake mode, the mobile phone may alsooutput another prompt, for example, a vibration feedback. The promptinformation 1313 may be displayed in a manner in which a preview imageis not blocked as much as possible, for example, a translucent manner ora transparent manner. The GUI may further include the direction control1311. The user may enter an image movement direction by using thedirection control 1311.

FIG. 21 is used as an example to describe how to record a video in theshake mode.

For a process in which the mobile phone switches from the common videorecording mode to the shake mode, refer to the switching from the commonvideo recording mode to the move mode. Details are not described hereinagain. In the shake mode, the mobile phone may achieve a shooting effectof “shaking a lens” by using the image movement direction entered by theuser. For a manner in which the user enters the image movement directionand a manner in which the user enters a movement stop instruction, referto the foregoing descriptions. Details are not described again.

Different from the move mode, in the shake mode, after determining atarget region on an image, the mobile phone performs angle of viewconversion on an image block in the target region, and then updates apreview image by using an image block obtained after the angle of viewconversion. FIG. 16 is used as an example. When the mobile phone detectsan image rightward shake instruction, the mobile phone determines anm^(th) region on an m^(th) frame of image and performs angle of viewconversion on an image block in the m^(th) region: the mobile phonedetermines an (m+1)^(th) region on an (m+1)^(th) frame of image andperforms time conversion on an image block in the (m+1)^(th) region; andso on. Therefore, after the mobile phone detects the image rightwardshake instruction, the mobile phone sequentially updates preview imagesto an image block in the m^(th) region that is obtained after the angleof view conversion, an image block in the (m+1)^(th) region that isobtained after the angle of view conversion, and the like.

It should be noted that the foregoing plurality of implementations inthe move mode such as the frame extraction manner and frame insertionmanner are also applicable to the shake mode. Details are not describedherein again.

For a process of performing angle of view conversion on an image block,refer to the foregoing descriptions. If the foregoing angle of viewconversion process is used, a rotation angle θ may be determined in aplurality of manners. For example, the rotation angle θ is preset, forexample, is a preset fixed value. Alternatively, if the user enters theimage movement direction by performing a flick operation on the screen,the rotation angle is related to the flick operation. For example, themobile phone stores a correspondence between a flick distance W of theflick operation and the rotation angle θ. When the mobile phone detectsa flick operation of the user on the screen, the mobile phone determinesa flick distance W of the flick operation, and determines acorresponding rotation angle θ based on the distance W and thecorrespondence. For example, a farther flick distance W of the flickoperation indicates a larger rotation angle. Alternatively, the rotationangle θ may be related to a display value of the identifier 1320.Assuming that the identifier 1320 displays “2”, the rotation angle θ istwo times a preset angle. A value of the preset angle is not limited inthis application.

Embodiment 3

In some embodiments, a size of an image captured by the ultra-wide-anglecamera is limited. When a first region is translated to an edge of theimage captured by the ultra-wide-angle camera, the mobile phone outputsprompt information, to prompt the user to move the position of themobile phone. The move mode is used as an example. Referring to FIG. 22, when the mobile phone detects that the user continuously presses thedown arrow, a position of a preview image on an image gradually movesdownward. When the position of the preview image on the image moves tothe edge of the image captured by the ultra-wide-angle camera, themobile phone may output prompt information 1330, to prompt the user tomanually move the mobile phone downward, or the mobile phone may outputprompt information used to prompt the user that the mobile phone cannotcontinue to move.

It should be understood that video recording starts when the mobilephone detects an operation on the recording control 1307. After startingthe recording, the user may also indicate to enter the move mode or theshake mode, and then enter an image movement direction. The mobile phonetranslates, in the direction, a position of a target region on the imagecaptured by the ultra-wide-angle camera, and continuously updates apreview image based on an image block in the target region. The mobilephone stores preview images; and when the mobile phone detects anoperation on the recording control for stopping, the mobile phonesynthesizes the stored preview images into a video and stores the video.

In some embodiments, after performing video recording in the shake modeor the move mode, the mobile phone may correspondingly store two videos.One video is a complete video, to be specific, each frame of image inthe video is a complete image captured by the ultra-wide-angle camera.The other video is a video recorded in the move mode or the shake mode,to be specific, each frame of image in the video is an image block on animage captured by the ultra-wide-angle camera. For example, referring toFIG. 23 , two videos are stored in a video folder in an album of themobile phone, where one video is a complete video, and the other videois a video recorded in the move mode or the shake mode. An identifier2301 may be displayed on the video recorded in the move mode or theshake mode, to facilitate distinguishing by the user.

Embodiment 4

In some other embodiments, the mobile phone may further provide an imagerotate mode. In this mode, an image rotation shooting effect may also beachieved when the user does not need to manually rotate the mobile phone(for example, the mobile phone remains stationary).

For example, when the mobile phone is in the move mode or the shakemode, if the mobile phone detects a preset operation on a preview image(for example, a double-tap operation or a touch and hold operation onthe preview image), the mobile phone enters the image rotate mode. FIG.24 is a schematic diagram of a viewfinder interface in the image rotatemode. The viewfinder interface includes indication information 1360 usedto indicate that the mobile phone is currently in the image rotate mode.Optionally, the prompt information 1360 may not be displayed. Theviewfinder interface further includes a preview box 1361, and an imagecaptured by the ultra-wide-angle camera (for example, a complete imagecaptured by the ultra-wide-angle camera) is displayed on the preview box1361. A target box 1362 is displayed in the preview box 1361, and animage block in the target box 1362 is a current preview image. Theviewfinder interface further includes an icon 1363 used to indicate arotation progress and an icon 1364 used to set a rotation speed.

For example, referring to FIG. 25 , assuming that the mobile phonedetects an image clockwise rotation instruction before a preview imageis updated to an m^(th) frame of image, the mobile phone determines atarget region on the m^(th) frame of image, that is, an m^(th) region,and rotates an image block in the m^(th) region clockwise by an angle G;the mobile phone determines an (m+1)^(th) region on an (m+1)^(th) frameof image, where a position of the (m+1)^(th) region remains unchangedrelative to that of the m^(th) region; and rotates an image block in the(m+1)^(th) region clockwise by an angle 2G; and so on. Therefore, afterthe mobile phone detects the image clockwise rotation instruction,preview images are sequentially updated to an image block in the m^(th)region that is obtained after the clockwise rotation by an angle G, animage block in the (m+1)^(th) region that is obtained after theclockwise rotation by an angle 2G, an image block in an (m+2)^(th)region that is obtained after clockwise rotation by an angle 3G, and thelike. Therefore, a preview image gradually rotates clockwise, and allupdated preview images rotate by a same angle, to be specific, rotate ata constant speed.

Assuming that a rotation stop instruction is detected before a previewimage is updated to an (m+3)^(th) frame of image, the mobile phonedetermines an (m+3)^(th) region on the (m+3)^(th) frame of image, wherea position of the (m+3)^(th) region remains unchanged relative to thatof the (m+2)^(th) region; and rotates an image block in the (m+3)^(th)region clockwise by an angle 3G, where the rotation angle of the imageblock in the (m+3)^(th) region remains unchanged relative to that of theimage block in the (m+2)^(th) region. In this case, the rotations stops.

It can be understood that, in the embodiment shown in FIG. 25 , rotationangles of two adjacent frames of images are the same and each are anangle G. However, rotation angles of two adjacent frames mayalternatively be different. For example, the rotation angle of the imageblock in the m^(th) region is G, and the rotation angle of the imageblock in the (m+1)^(th) region is 3G. In this case, a preview imagerotates at an accelerated speed. Alternatively, the rotation angle ofthe image block in the m^(th) region is G, and the rotation angle of theimage block in the (m+1)^(th) region is 0.5G. In this case, a previewimage rotates at a decelerated speed.

It should be noted that the foregoing frame extraction updating manneror frame insertion updating manner is also applicable to thisembodiment. For example, the accelerated rotation may be implementedthrough frame extraction, and the decelerated rotation may beimplemented through frame insertion. For example, referring to FIG. 24 ,it is assumed that the user expects to increase a rotation angle whenthe mobile phone detects an operation above “+” on the icon 1364. Inthis case, the mobile phone may implement the accelerated rotationthrough frame extraction. This is similar to the manner of extractingone frame every other frame in the embodiment shown in FIG. 19A Thisachieves an effect that each updated preview image rotates by an angle2G. It is assumed that the user expects to decrease a rotation anglewhen the mobile phone detects an operation on “−” below the icon 1364.In this case, the mobile phone may implement the decelerated rotationthrough frame insertion. This is similar to the manner of inserting oneframe every other frame in the embodiment shown in FIG. 10B. Thisachieves an effect that each updated preview image rotates by an angle0.5G.

The foregoing mentions that there may be a plurality of manners in whichthe mobile phone detects an instruction used to indicate an imagerotation direction. For example, referring to FIG. 24 , when the mobilephone detects an operation on the icon 1363, clockwise orcounterclockwise rotation starts by default, which may be voluntarilyset by the user. For another example, a left arrow and a right arrow aredisplayed at the icon 1363. When the mobile phone detects that the usertaps the left arrow, the counterclockwise rotation starts. When themobile phone detects that the user taps the right arrow, the clockwiserotation starts.

For example, rotation starts after the mobile phone detects an operationof tapping the icon 1363, and the rotation automatically stops whenpreset rotation duration (for example, 5 s) is reached. The mobile phonemay store a video obtained by synthesizing preview images displayed in aperiod from the beginning to the end of the rotation.

Alternatively, rotation starts after the mobile phone detects anoperation of tapping the icon 1363, and the rotation continues until360-degree rotation is completed.

Alternatively, rotation starts after the mobile phone detects anoperation of tapping the icon 1363, and the rotation continues until theuser enters a rotation stop instruction. For example, the rotation stopswhen the mobile phone detects a tap operation of the user at anyposition on the preview interface, or the rotation stops when the mobilephone detects an operation of tapping the icon 1363 again.

Alternatively, rotation starts when the mobile phone detects anoperation of touching and holding the icon 1363 (when duration ofpressing the icon 1363 is greater than preset duration), and therotation stops when the mobile phone detects an uplift after the touchand hold operation.

It can be understood that image rotation may be performed before videorecording starts (for example, before a video recording control used toindicate to start video recording is tapped), or may be performed aftervideo recording starts (for example, after a video recording controlused to indicate to start video recording is tapped).

For example, FIG. 26 is a schematic diagram of an image counterclockwiserotation. In a process in which a preview image rotatescounterclockwise, the target box 1362 on the viewfinder interface mayalso synchronously rotate, to notify the user of an approximate rotationangle of a current preview image. A current rotation progress may alsobe displayed on the icon 1363. A rotation direction of the target box1362 may be the same as or different from a rotation direction of apreview image. This is not limited in this embodiment of thisapplication.

Embodiment 5

In some other embodiments, the mobile phone may further provide thepush-pull mode. In the push-pull mode, the mobile phone can achieve ashooting effect of “pushing a lens” or “pulling a lens”. Herein,“pushing a lens” may be understood as that a camera approaches anobject, to be specific, an object on a viewfinder interface ismagnified. This helps focus on object details. In addition, “pulling alens” may be understood as that a camera moves away from an object, tobe specific, an object on a viewfinder interface is de-magnified. Thishelps panoptic shooting.

For example, when the mobile phone is in the image rotate mode, the movemode, or the shake mode, if the mobile phone detects a preset operationon a preview image (for example, a double-tap operation or a touch andhold operation on the preview image), the mobile phone enters thepush-pull mode. The embodiments of this application provide a pluralityof modes including the common video recording mode, the shake mode, themove mode, the image rotate mode, and the push-pull mode. In someembodiments, when the mobile phone detects a double-tap operation of theuser on a preview image, cyclic switching between different modes isimplemented.

FIG. 27 is a schematic diagram of a viewfinder interface in thepush-pull mode. The viewfinder interface includes indication information1370 used to indicate that the mobile phone is currently in thepush-pull mode. Optionally, the prompt information 1370 may not bedisplayed. The viewfinder interface further includes a preview box 1371,and an image captured by the ultra-wide-angle camera is displayed in thepreview box 1371. A target box 1372 is displayed in the preview box1371, and an image block in the target box 1372 is a current previewimage. The viewfinder interface further includes an icon 1373 used toindicate to pull a lens, an icon 1374 used to indicate to push a lens,and an icon 1375 used to set a push-pull speed.

An example of pulling a lens is used in the following embodiment todescribe a shooting process of pulling a lens when the mobile phoneremains stationary.

For example, referring to FIG. 28 , assuming that the mobile phonedetects a lens pull instruction before a preview image is updated to anm^(th) frame of image, the mobile phone determines a target region onthe m^(th) frame of image, that is, an m^(th) region, where an area ofthe m^(th) region is greater than an area of the (m−1)^(th) region; themobile phone determines an (m+1)^(th) region on an (m+1)^(th) frame ofimage, where an area of the (m+1)^(th) region is greater than the areaof the (m+1)^(th) region; and so on. Therefore, after the mobile phonedetects the lens pull instruction, preview images are sequentiallyupdated to an image block in the m^(th) region, an image block in the(m+1)^(th) region, an image block in an (m+2)^(th) region, and the like.In this way, an area occupied by a preview image on an image graduallyincreases, and an angle of view range of the preview image becomeslarger. This achieves a shooting effect that a camera gradually movesaway from an object.

Assuming that a lens pull stop instruction is detected before a previewimage is updated to an (m+3)^(th) frame of image, the mobile phonedetermines an (m+3)^(th) region on the (m+3)^(th) frame of image, wherean area of the (m+3)^(th) region remains unchanged relative to that ofthe (m+2)^(th) region. In this case, the lens pull stops. Therefore,after the mobile phone detects a lens pull stop instruction, an areaoccupied by a preview image does not increase, and the camera does notmove away from an object visually.

It can be understood that, in the embodiment shown in FIG. 28 , areachange amounts of target regions on two adjacent frames of images may bethe same or different. Assuming that area increase amounts of targetregions on two adjacent frames of images are the same, in other words,an area of a target region increases at a constant speed, a shootingeffect that a camera moves away from an object at a constant speed isachieved. Assuming that the area of the (m+1)^(th) region is S greaterthan the area of the m^(th) region and the area of the (m+2)^(th) regionis 2 S greater than the area of the (m+1)^(th) region, in other words,an area of a target region increases at an accelerated speed, a shootingeffect that a preview image moves away from an object at an acceleratedspeed is achieved. Assuming that the area of the (m+1)^(th) region is Sgreater than the area of the m region and the area of the (m+2)^(th)region is 0.5 S greater than the area of the (m+1)^(th) region, in otherwords, an area of a target region increases at a decelerated speed, ashooting effect that a preview image moves away from an object at adecelerated speed (slowly) is achieved.

It should be noted that the foregoing frame extraction updating manneror frame insertion updating manner is also applicable to this embodimentto achieve different effects. Details are not described herein again.

The mobile phone obtains the lens pull instruction in a plurality ofmanners, including but not limited to the following manners.

For example, the area of the target region starts to increase after themobile phone detects an operation of tapping the icon 1373, and theincrease automatically stops when preset duration (for example, 5 s) isreached. The mobile phone may store a video obtained by synthesizingpreview images displayed in a period from the beginning to the end ofthe increase.

Alternatively, the area of the target region starts to increase afterthe mobile phone detects an operation of tapping the icon 1373, and theincrease continues until the area of the target region is equal to anarea of a complete image captured by the ultra-wide-angle camera.

Alternatively, the area of the target region starts to increase afterthe mobile phone detects an operation of tapping the icon 1373, and theincrease continues until it is detected that the user enters an increasestop instruction. For example, the increase stops when the mobile phonedetects a tap operation of the user at any position on the previewinterface, or the increase stops when the mobile phone detects anoperation of tapping the icon 473 again.

Alternatively, the area of the target region starts to increase when themobile phone detects an operation of touching and holding the icon 1373(when duration of pressing the icon 1373 is greater than presetduration), and the increase stops when the mobile phone detects anuplift after the touch and hold operation.

FIG. 29 is used as an example. When the mobile phone detects that theuser taps the icon 1373 used to indicate to pull a lens, an area of atarget region on an image starts to increase. Correspondingly, a previewimage is gradually updated to an image block in a larger target region.This achieves a shooting effect that an object gradually moves away froma camera. Still referring to FIG. 29 , an area of the target box 1372 onthe viewfinder interface may be synchronously increased, to notify theuser of an approximate proportion of a current preview image to acomplete image.

It should be noted that an example of pulling a lens is used above, anda similar manner may be used for pushing a lens. For example, when themobile phone detects a lens push instruction, the mobile phone maydetermine a target region in a manner similar to that shown in FIG. 28 .A difference lies in that an area of a target region on a next frame ofimage is smaller than an area of a target region on a previous frame ofimage, so that preview image magnification is implemented. When themobile phone detects a lens push stop instruction, the area of thetarget region stops decreasing, so that the preview image magnificationstops.

In some embodiments, after obtaining a video through recording in themove mode, the shake mode, or the image rotate mode, the mobile phonemay automatically make music for the video. For example, the mobilephone makes music for the video by using a selected sound. The sound maybe a sound selected in advance by the user from a plurality of soundsprovided by the camera application. The sound herein may include a songclip, a ringtone, another sound, or the like. This is not limited inthis embodiment of this application.

It should be noted that the implementations of this application may berandomly combined to achieve different technical effects. For example,in a process in which a preview image rotates clockwise, the previewimage is gradually de-magnified or magnified; or when a position of apreview image on an image gradually moves leftward, the preview image isgradually magnified. This is not limited in this embodiment of thisapplication.

With reference to the foregoing embodiments and the related accompanyingdrawings, an embodiment of this application provides a method fordisplaying a preview image in a video recording scenario. The method maybe implemented by the electronic device (for example, a mobile phone ora tablet computer) shown in FIG. 2 . As shown in FIG. 30 , the methodmay include the following steps.

3001: Detect a first operation used to open a camera application.

FIG. 13(a) is used as an example. The first operation is, for example,an operation that the user taps the icon 402.

3002: Start the camera application in response to the first operation.

3003: Detect a second operation used to indicate a first video recordingmode.

In this embodiment of this application, the electronic device mayprovide a plurality of recording modes, for example, a common videorecording mode and the first video recording mode (for example,including a move mode and a shake mode). The electronic device may entera mode under a user instruction. FIG. 14(a) is used as an example. Theelectronic device displays the viewfinder interface in the common videorecording mode, and the electronic device displays the selection box1309 after detecting an operation of tapping the control 408 used toindicate a camera movement mode. The second operation may be anoperation of tapping the option “Shake mode” or “Move mode” in theselection box 1309. Assuming that the second operation is an operationof tapping the option “Move mode” in the selection box 1309, theelectronic device enters the move mode.

3004: Display a viewfinder interface on a display of the electronicdevice in response to the second operation, where the viewfinderinterface includes a first preview image, and the first preview image isa first image block in a first region on a first image captured by afirst wide-angle camera on the electronic device.

FIG. 14(b) is still used as an example. When the electronic devicedetects the second operation (an operation of tapping the option “Movemode” in the selection box 1309), the electronic device enters the movemode, and displays the first preview image on the viewfinder interface,where the first preview image is the first image block in the firstregion on the first image captured by the first wide-angle camera (forexample, an ultra-wide-angle camera). For example, the first image isthe image shown in FIG. 17 , and the first preview image is an imageblock in the first region on the first image.

It can be understood that the electronic device uses a second wide-anglecamera in the common video recording mode. When detecting the secondoperation used to indicate the first video recording mode (for example,the move mode), the electronic device starts the first wide-anglecamera. An angle of view of the second wide-angle camera is less than anangle of view of the first wide-angle camera. The first wide-anglecamera is, for example, an ultra-wide-angle camera, and the secondwide-angle camera is, for example, a common wide-angle camera. In otherwords, after the electronic device switches from the common videorecording mode to the move mode, the electronic device switches from thecommon wide-angle camera to the ultra-wide-angle camera, and the firstpreview image is the first image block in the first region on the firstimage captured by the ultra-wide-angle camera. It can be understood thatthe first image may be a first frame of image captured by theultra-wide-angle camera after the electronic device switches from thecommon video recording mode to the first video recording mode and startsthe ultra-wide-angle camera.

3005: Keep a position of the electronic device unchanged, and detect athird operation that indicates an image movement direction.

The third operation may be implemented in a plurality of manners. FIG.16 is used as an example. The third operation may be an operation thatthe user taps an arrow (for example, the right arrow) on the directioncontrol 1311, and a direction indicated by the arrow is the imagemovement direction. Alternatively, the third operation may be anoperation that the user presses an arrow in press duration that reachespreset duration, and a direction indicated by the arrow is the imagemovement direction. Alternatively, the third operation is an operationthat the user presses and drags (or flicks) the video recording control1307 in a direction, and the drag direction is the image movementdirection. Alternatively, the third operation is a flick operation ofthe user on a screen (for example, a preview image), and a flickdirection of the flick operation is the image movement direction.Alternatively, when the method provided in this embodiment of thisapplication is applied to a device such as a notebook computer, thethird operation may be an operation of entering the image movementdirection by using a keyboard, a touchpad, or the like.

3006: Display a second preview image on the viewfinder interface inresponse to the third operation, where the second preview image is asecond image block in a second region on a second image captured by thefirst wide-angle camera, or the second preview image is an image blockobtained after angle of view conversion is performed on the second imageblock; and an orientation of the second region relative to the firstregion is related to the image movement direction.

It should be noted that the first image may be a first frame of imagecaptured by the ultra-wide-angle camera after the electronic deviceswitches from the common video recording mode to the first videorecording mode and starts the ultra-wide-angle camera. FIG. 18 is usedas an example. The first preview image is the first image block in thefirst region on the first frame of image. It is assumed that the thirdoperation used to indicate the image rightward movement is detected in aperiod from the (m−1)^(th) frame of image to the m^(th) frame of image.The second preview image is the m^(th) image block in the m^(th) region(that is, the second region) on the m^(th) frame of image (that is, thesecond image), or the second preview image is the image block obtainedafter angle of view conversion is performed on the m^(th) image block inthe m^(th) region on the m^(th) frame of image. An orientation of them^(th) region (that is, the second region) relative to the first regionchanges.

Optionally, the orientation of the second region relative to the firstregion is the same as or opposite to the image movement direction. Forexample, if the image movement direction entered by the user isrightward and the second region is on the right of the first region, aposition of a preview image on an image captured by the ultra-wide-anglecamera moves rightward; or if the user enters an image rightwardmovement instruction and the second region is on the left of the firstregion, a position of a preview image on an image moves leftward. Theuser may voluntarily set the image movement direction entered by theuser to be the same as or opposite to the movement direction in whichthe position of the preview image on the image captured by theultra-wide-angle camera moves.

In the foregoing descriptions, that an orientation of the second regionrelative to the first region is related to the image movement directionmay be understood as follows: a distance between the second region and afirst edge of the second image is a second distance, a distance betweenthe first region and a first edge of the first image is a firstdistance, and a distance change amount of the second distance relativeto the first distance is related to the image movement direction. Thefirst edge may be an upper edge, a lower edge, a left edge, a rightedge, or the like of the image captured by the ultra-wide-angle camera.For example, if the image movement direction is leftward or rightward,the first edge may be the left edge or the right edge. If the imagemovement direction is upward or downward, the first edge may be theupper edge or the lower edge. FIG. 18 is used as an example. It isassumed that the first edge is the left image edge, the second distancebetween the second region (that is, the m^(th) region) and the left edgeof the second image (that is, the m^(th) frame of image) is H+A, and thefirst distance between the first region and the left edge of the firstimage is H. In this case, the distance change amount of the seconddistance relative to the first distance is A. The distance change amountA has a plurality of cases, and is related to the image movementdirection. For example, when the image movement direction is rightwardand A is greater than 0, the second region moves rightward relative tothe first region. When the image movement direction is leftward and A isless than 0, the second region moves leftward relative to the firstregion.

A third preview image after the second preview image may be a thirdimage block in a third region on a third image captured by theultra-wide-angle camera. FIG. 18 is still used as an example. If thesecond image is the m^(th) frame of image, the third image may be the(m+1)^(th) frame of image, and the third region is the (m+1)^(th) regionon the (m+1)^(th) frame of image. In this case, the third preview imageis the (m+1)^(th) image block in the (m+1)^(th) region on the (m+1)^(th)frame of image. By analogy, a fourth preview image after the thirdpreview image may be the (m+2)^(th) image block in the (m+2)^(th) regionon the (m+2)^(th) frame of image, and the like.

FIG. 18 is still used as an example. A second orientation change amountof the third region (that is, the (m+1)^(th) region on the (m+1)^(th)frame of image) relative to the second region (that is, the m^(th)region on the m^(th) frame of image) is a distance change amount of thethird distance relative to the second distance. The third distance is adistance between the third region and a first edge (for example, a leftimage edge) of the third image, to be specific, is H+A+B; and the seconddistance is a distance between the second region and the first edge (forexample, the left image edge) of the second image, to be specific, isH+A In this case, the second orientation change amount is B.

A first orientation change amount of the second region (that is, them^(th) region on the m^(th) frame of image) relative to the first region(that is, the first region on the first frame of image) is the distancechange amount of the second distance relative to the first distance. Thesecond distance is the distance between the second region and the firstedge (for example, the left image edge) of the second image, to bespecific, is H+A; and the first distance is the distance between thefirst region and the first edge of the first image, to be specific, isH. In this case, the first orientation change amount is A.

In some embodiments, the second orientation change amount B is equal tothe first orientation change amount A. In other words, orientationchange amounts of preview images on images are the same. To be specific,a position of a preview image on an image moves at a constant speed.Certainly, the second orientation change amount B may be less than orgreater than the first orientation change amount A, to achieve differenteffects. For details, refer to the foregoing descriptions. Details arenot described again.

In a possible implementation, the third operation is used to indicate animage movement direction. In this possible implementation, afterdetecting the third operation, the electronic device is in a previewmode. In the preview mode, a position of a preview image on an imagecaptured by the ultra-wide-angle camera changes according to the imagemovement direction. When detecting an operation on the video recordingcontrol 1307, the electronic device starts video recording. After thevideo recording starts, a position of a preview image on an imagechanges continuously. When a video recording stop instruction isdetected, the video recording stops.

In another possible implementation, the third operation not only may beused to indicate an image movement direction, but also may be used toindicate to start video recording. FIG. 16 is used as an example. Whendetecting a third operation that the user taps an arrow (for example,the right arrow) on the direction control 411, the electronic devicedisplays the second preview image, and starts video recording. Whendetecting an image movement stop instruction, the electronic devicestops the movement and the video recording, and stores a video. Thevideo includes the second preview image.

FIG. 18 is used as an example. When the electronic device detects theimage rightward movement instruction, the electronic device displays them^(th) image block in the m^(th) region on the m^(th) frame of image onthe viewfinder interface, and starts video recording. Then, previewimages are sequentially updated to the image block in the (m+1)^(th)region and the image block in the (m+2)^(th) region. Until theelectronic device detects the movement stop instruction, the electronicdevice stops the video recording and stores a video, where the videoincludes the m^(th) image block, the (m+1)^(th) image block, and the(m+2)^(th) image block.

Optionally, the second image is one of M frames of images obtainedthrough frame extraction from N frames of images captured by the firstwide-angle camera, where N is an integer greater than or equal to 1, andM is an integer less than N. For a specific frame extraction process,refer to the descriptions in FIG. 10A or FIG. 19B. Details are notdescribed herein again. Alternatively, the second image is one of Mframes of images obtained through multi-frame image insertion into Nframes of images captured by the first wide-angle camera, where N is aninteger greater than or equal to 1, and M is an integer greater than N.For a specific frame insertion process, refer to the descriptions inFIG. 19C or FIG. 19D. Details are not described herein again.

With reference to the foregoing embodiments and the related accompanyingdrawings, an embodiment of this application provides a method fordisplaying a preview image in a video recording scenario. The method maybe implemented by the electronic device (for example, a mobile phone ora tablet computer) shown in FIG. 2A. As shown in FIG. 31 , the methodmay include the following steps.

3101: Detect a first operation used to open a camera application.

3102: Start the camera application in response to the first operation.

For descriptions of step 3101 and step 3102, refer to the descriptionsof step 3001 and step 3002 in FIG. 30 . Details are not described hereinagain.

3103: Detect a second operation used to indicate a first video recordingmode.

For example, the electronic device may provide a plurality of videorecording modes such as a common video recording mode and an imagerotation video recording mode. FIG. 16 is used as an example. Theelectronic device displays the viewfinder interface in the move mode,and the second operation may be an operation of double tapping theviewfinder interface, or another operation that may be used to switch tothe image rotation video recording mode. FIG. 14(b) is used as anexample. The second operation may be an operation of tapping an option“Image rotation” in the selection box 409.

3104: Display a viewfinder interface on a display of the electronicdevice in response to the second operation, where the viewfinderinterface includes a first preview image, and the first preview image isa first image captured by a camera on the electronic device.

In some embodiments, the camera is a common camera or a first wide-anglecamera. The first wide-angle camera is used as an example. The firstimage is a first image block in a first region on a first frame of imagecaptured by the first wide-angle camera.

FIG. 14(b) is still used as an example. When detecting the secondoperation (an operation of tapping the option “Image rotation” in theselection box 1309), the electronic device enters the image rotationvideo recording mode. For a viewfinder interface in the image rotationvideo recording mode, refer to FIG. 24 . A first preview image isdisplayed on the viewfinder interface, and the first preview image is afirst image block in a first region on a first frame of image capturedby the first wide-angle camera (for example, a wide-angle camera).

It can be understood that the electronic device uses a second wide-anglecamera in the common video recording mode. When detecting the secondoperation used to indicate the first video recording mode (for example,the image rotation video recording mode), the electronic device startsthe first wide-angle camera. An angle of view of the second wide-anglecamera is less than an angle of view of the first wide-angle camera. Thefirst wide-angle camera is, for example, an ultra-wide-angle camera, andthe second wide-angle camera is, for example, a common wide-anglecamera. In other words, after the electronic device switches from thecommon video recording mode to the image rotation video recording mode,the electronic device switches from the common wide-angle camera to theultra-wide-angle camera, and the first preview image is the first imageblock in the first region on the first frame of image captured by theultra-wide-angle camera.

3105: Keep a position of the electronic device unchanged, and detect athird operation that indicates an image rotation direction.

The third operation may be implemented in a plurality of manners. FIG.24 is used as an example. The third operation may be an operation oftapping the icon 1363. For example, after the icon 1363 is tapped,clockwise or counterclockwise rotation starts by default. Alternatively,the third operation may be an operation of drawing a circle on theviewfinder interface, and a circle drawing direction of the circledrawing operation is the image rotation direction. Alternatively, thethird operation may be an operation of tapping the left arrow on theleft of the icon 1363, and the image rotation direction iscounterclockwise rotation. Alternatively, the third operation may be anoperation of tapping the right arrow on the right of the icon 1363, andthe image rotation direction is clockwise rotation.

3106: Display a second preview image on the viewfinder interface inresponse to the third operation, where the second preview image is animage obtained after a second image captured by the camera rotates inthe image rotation direction.

For example, if the camera is the first wide-angle camera (for example,the ultra-wide-angle camera), the first image may be a first frame ofimage captured by the ultra-wide-angle camera after the electronicdevice switches from the common video recording mode to the first videorecording mode (that is, the image rotation video recording mode) andstarts the ultra-wide-angle camera. FIG. 25 is used as an example. Thefirst preview image is the first image block in the first region on thefirst frame of image. It is assumed that a third operation used toindicate image clockwise rotation is detected in a period from the(m−1)^(th) frame of image to the m^(th) frame of image. The electronicdevice determines the m^(th) image block in the m^(th) region (that is,the second region) on the m^(th) frame of image (that is, the secondimage), where the second preview image is an image block obtained afterthe m^(th) image block rotates by an angle G.

Optionally, a rotation direction of the second image relative to thefirst image is the same as or opposite to the image rotation directionindicated by the third operation. This is not limited in this embodimentof this application.

In some embodiments, a third preview image is displayed on theviewfinder interface after the second preview image, where the thirdpreview image is an image obtained after a third image captured by thecamera rotates in the image rotation direction, and a rotation angle ofthe third image relative to the second image is the same as a rotationangle of the second image relative to the first image. For example, ifthe camera is the first wide-angle camera (the ultra-wide-angle camera),the third preview image after the second preview image may be an imageblock obtained after a third image block in a third region on the thirdimage captured by the ultra-wide-angle camera rotates by a specificangle. FIG. 25 is still used as an example. The second image is them^(th) frame of image, the second region is the m^(th) region, and thesecond preview image is an image block obtained after the image block inthe m^(th) region rotates by an angle G. The third image is the(m+1)^(th) frame of image, the third region is the (m+1)^(th) region,and the third preview image is an image block obtained after the imageblock in the (m+1)^(th) region rotates by an angle 2G. Therefore, arotation angle of the third region relative to the second region isequal to a rotation angle of the second region relative to the firstregion. To be specific, a preview image rotates at a constant speed.Certainly, the rotation angle of the third region relative to the secondregion may be different from the rotation angle of the second regionrelative to the first region. For example, if the rotation angle of thethird region relative to the second region is greater than the rotationangle of the second region relative to the first region, the rotation isaccelerated. If the rotation angle of the third region relative to thesecond region is less than the rotation angle of the second regionrelative to the first region, the rotation is decelerated.

In a possible implementation, the third operation is used to indicate animage rotation direction. In this possible implementation, afterdetecting the third operation, the electronic device is in a previewmode. In the preview mode, a previewed picture rotates. When detectingan operation on the video recording control 1307, the electronic devicestarts video recording. After the video recording starts, the previewimage continues to rotate. When a video recording stop instruction isdetected, the video recording stops.

In another possible implementation, the third operation not only may beused to indicate an image rotation direction, but also may be used toindicate to start video recording. FIG. 24 is used as an example. Whendetecting a third operation that the user taps the left arrow on theleft of the icon 1363, the electronic device displays the second previewimage, and starts video recording. When detecting a rotation stopinstruction, the electronic device stops the rotation and the videorecording, and stores a video. The video includes the second previewimage.

FIG. 25 is used as an example. When the electronic device detects theimage clockwise rotation instruction, the electronic device displays, onthe viewfinder interface, an image block obtained after the m^(th) imageblock in the m^(th) region rotates by an angle G, and starts videorecording. Then, preview images are sequentially updated to image blocksobtained after the image block in the (m+1)^(th) region and the imageblock in the (m+2)^(th) region rotate at a specific angle. Until theelectronic device detects the rotation stop instruction, the electronicdevice stops the video recording and stores a video, where the videoincludes an image block obtained after the m^(th) image block rotates byan angle G, an image block obtained after the (m+1)^(th) image blockrotates by an angle 2G, and an image block obtained after the (m+2)^(th)image block rotates by an angle 3G.

Optionally, the second image may be one of M frames of images obtainedthrough frame extraction from N frames of images captured by the firstwide-angle camera, where N is an integer greater than or equal to 1, andM is an integer less than N. For a specific frame extraction process,refer to the descriptions in FIG. 19A or FIG. 19B. Details are notdescribed herein again. Alternatively, the second image is one of Mframes of images obtained through multi-frame image insertion into Nframes of images captured by the first wide-angle camera, where N is aninteger greater than or equal to 1, and M is an integer greater than N.For a specific frame insertion process, refer to the descriptions inFIG. 19C or FIG. 19D. Details are not described herein again.

The terms used in the following embodiments are merely intended todescribe specific embodiments, but are not intended to limit thisapplication. The terms “one”, “a”, “the”, “the foregoing”, “this”, and“the one” of singular forms used in this specification and the appendedclaims of this application are also intended to include plural formssuch as “one or more”, unless otherwise specified in the contextclearly. It should be further understood that, in the embodiments ofthis application, “one or more” means one, two, or more. In addition,“and/or” describes an association relationship between associatedobjects, and indicates that three relationships may exist. For example,A and/or B may indicate a case in which only A exists, both A and Bexist, and only B exists, where A and B may be singular or plural. Thecharacter “/” usually indicates an “or” relationship between theassociated objects.

Reference to “an embodiment”, “some embodiments”, or the like describedin this specification indicates that one or more embodiments of thisapplication include a specific feature, structure, or characteristicdescribed with reference to the embodiments. Therefore, in thisspecification, statements such as “in an embodiment”, “in someembodiments”, “in some other embodiments”, and “in other embodiments”that appear at different places do not necessarily mean referring to asame embodiment. Instead, the statements mean referring to “one or morebut not all of the embodiments”, unless otherwise specified in othermanners. The terms “include”, “comprise”, “have”, and variants of theterms all mean “include but are not limited to”, unless otherwisespecified in other manners.

In the embodiments provided in this application, the method provided inthe embodiments of this application is described from the perspective inwhich the mobile device (for example, the mobile phone) is used as anexecution body. To implement functions in the method provided in theembodiments of this application, the terminal device may include ahardware structure and/or a software module, and implement the functionsin a form of the hardware structure, the software module, or acombination of the hardware structure and the software module. Whether aspecific function in the foregoing functions is performed by thehardware structure, the software module, or the combination of thehardware structure and the software module depends on a specificapplication and a design constraint condition of the technicalsolutions.

According to the context, the term “when” or “after” used in theforegoing embodiments may be interpreted as a meaning of “if”, “after”,“in response to determining”, or “in response to detecting”. Similarly,according to the context, the phrase “when it is determined that” or “if(a stated condition or event) is detected” may be interpreted as ameaning of “when it is determined that”, “in response to determining”,“when (a stated condition or event) is detected”, or “in response todetecting (a stated condition or event)”. In addition, in the foregoingembodiments, relational terms such as first and second are used todistinguish one entity from another, and any actual relationship andorder between these entities are not limited.

All or some of the foregoing embodiments may be implemented by usingsoftware, hardware, firmware, or any combination thereof. When thesoftware is used to implement the embodiments, the embodiments may beimplemented all or partially in a form of a computer program product.The computer program product includes one or more computer instructions.When the computer program instructions are loaded and executed on acomputer, all or some of the procedures or the functions according tothe embodiments of the present invention are generated. The computer maybe a general-purpose computer, a special-purpose computer, a computernetwork, or another programmable apparatus. The computer instructionsmay be stored in a computer-readable storage medium or may betransmitted from a computer-readable storage medium to anothercomputer-readable storage medium. For example, the computer instructionsmay be transmitted from a website, computer, server, or data center toanother website, computer, server, or data center in a wired (forexample, a coaxial cable, an optical fiber, or a digital subscriber line(DSL)) or wireless (for example, infrared, radio, or microwave) manner.The computer-readable storage medium may be any usable medium accessibleby a computer, or a data storage device, such as a server or a datacenter, integrating one or more usable media. The usable medium may be amagnetic medium (for example, a floppy disk, a hard disk, or a magnetictape), an optical medium (for example, a DVD), a semiconductor medium(for example, a solid-state drive Solid State Disk (SSD)), or the like.

It should be noted that a part of this patent application documentincludes content protected by a copyright. The copyright owner reservesthe copyright except for making a copy of the patent documents of thePatent Office or the content of the recorded patent documents.

1.-12. (canceled)
 13. An electronic device comprising: processor; and a memory coupled to the processor and configured to store instructions, wherein when executed by the processor, the instructions cause the electronic device to: enable a camera function; obtain, for the camera function, a first operation of a user; determine, in response to the first operation, a first video recording template comprising a first example sample corresponding to a first camera movement mode, a second example sample corresponding to a second camera movement mode, and a preset audio, wherein the first camera movement mode is different from the second camera movement mode; display a video recording interface comprising a first camera movement mode identifier identifying the first camera movement mode and a second camera movement mode identifier identifying the second camera movement mode; obtain a second operation of the user; maintain a position of the electronic device and start a video recording in response to the second operation; generate, during the video recording, a first video clip in the first camera movement mode; generate, during the video recording, a second video clip in the second camera movement mode; and generate a first synthetic video comprising the first video clip, the second video clip, and the preset audio.
 14. The electronic device of claim 13, wherein when executed by the processor, the instructions further cause the electronic device is to: obtain a shooting indication by the user; further generate, when the first camera movement mode identifier is selected and in response to the shooting indication, the first video clip, wherein the first video clip is of a first preset duration; and further generate, when the second camera movement mode identifier is selected and in response to the shooting indication, the second video clip, wherein the second video clip is of a second preset duration.
 15. The electronic device of claim 14, wherein when executed by the processor, the instructions further cause the electronic device: display, on the video recording interface, a first countdown of generating the first video clip when generating the first video clip; and display, on the video recording interface, a second countdown of generating the second video clip when generating the second video clip.
 16. The electronic device of claim 13, wherein when executed by the processor, the instructions further cause the electronic device: obtain a third operation of the user; delete, in response to the third operation and from the video recording interface, the first camera movement mode identifier or the second camera movement mode identifier; obtain a fourth operation of the user; maintain the position and start recording in response to the fourth operation; and generate a second synthetic video comprising the preset audio and a third video clip generated in a remaining camera movement mode that is not deleted from the first camera movement mode and the second camera movement mode.
 17. The electronic device of claim 13, wherein when executed by the processor, the instructions further cause the electronic device: obtain a third operation of the user; add, in response to the third operation and to the video recording interface, a third camera movement mode identifier indicating a third camera movement mode; obtain a fourth operation of the user; maintain the position and start recording in response to the fourth operation; and generate a second synthetic video comprising the first video clip, the second video clip, a third video clip generated in the third camera movement mode, and the preset audio.
 18. The electronic device of claim 13, wherein when executed by the processor, the instructions further cause the electronic device to: obtain a third operation of the user; adjust, in response to the third operation, a first order of displaying the first camera movement mode identifier and the second camera movement mode identifier to a second order; obtain a fourth operation of the user; maintain the position and start recording in response to the fourth operation; and generate a second synthetic video, wherein, in the second synthetic video, the first video clip and the second video clip are in the second order.
 19. The electronic of claim 13, wherein when executed by the processor, the instructions further cause the electronic device to display, on the video recording interface, the first example sample, the second example sample, or both the first example sample and the second example sample.
 20. The electronic device of claim 13, wherein when executed by the processor, the instructions further cause the electronic device to: display a presentation interface comprising the first video clip and the second video clip; obtain, from the user, a video synthesizing instruction; and perform, in response to the video synthesizing instruction, video synthesizing to obtain the first synthetic video.
 21. The electronic device of claim 13, wherein when executed by the processor, the instructions further cause the electronic device: obtain a third operation of the user and delete the first video clip or the second video clip in response to the third operation; add a local third video clip to the first synthetic video; or adjust an order of playing the first video clip or the second video clip in the first synthetic video.
 22. The electronic device of claim 13, wherein the first video recording template is a default template or a user-defined template. 23.-24. (canceled)
 25. An electronic device comprising: a first wide-angle camera configured to capture a first image and a second image; a display; and a processor coupled to the display and the first wide-angle camera and configured to cause the electronic device to: detect a first operation for opening a camera application; start, in response to the first operation, the camera application; detect a second operation indicating a first video recording mode; display, in response to the second operation and on the display, a viewfinder interface comprising a first preview image, wherein the first preview image is a first image block in a first region in the first image; maintain a position of the electronic device; detect a third operation indicating a first image movement direction; and display, on the viewfinder interface in response to the third operation, a second preview image that is either a second image block in a second region in the second image or a third image block that is based on an angle of view conversion on the second image block, wherein an orientation of the second region relative to the first region is related to the first image movement direction.
 26. The electronic device of claim 25, wherein the orientation is the same as or opposite to the first image movement direction.
 27. The electronic device of claim 25, wherein a second distance is between the second region and a second edge of the second image, wherein a first distance is between the first region and a first edge of the first image, and wherein a distance change amount of the second distance relative to the first distance is related to the first image movement direction.
 28. The electronic device of claim 25, wherein the processor is further configured to cause the electronic device to display, on the viewfinder interface, a third preview image that is either a fourth image block in a third region on a third image or a fifth image block obtained after the angle of view conversion is performed on the fourth image block, wherein a second orientation change amount of the third region relative to the second region is equal to a first orientation change amount of the second region relative to the first region, wherein the second orientation change amount is a first distance change amount of a third distance relative to a second distance between the second region and a second edge of the second image, wherein the first orientation change amount is a second distance change amount of the second distance relative to a first distance between the first region and a first edge of the first image, and wherein the third distance is between the third region and a third edge of the third image.
 29. The electronic device of claim 25, further comprising a second wide-angle camera coupled to the processor and configured to capture a third image, wherein a second field of view of the second wide-angle camera is less than a first field of view of the first wide-angle camera, wherein before detecting the second operation, the processor is further configured to cause the electronic device to display, on the viewfinder interface, the third image as a third preview image and wherein the first preview image is some or all of image blocks within an overlapping range between the first field of view and the second field of view.
 30. The electronic device of claim 25, wherein the third operation comprises: a flick operation on the first preview image; a fourth operation on a first control for indicating an image rotation direction on the viewfinder interface; or a fifth operation of pressing and dragging a second control on the viewfinder interface.
 31. The electronic device of claim 25, wherein the processor is further configured to cause the electronic device to: detect an image movement stop instruction; and generate and store, in response to the image movement stop instruction, a video comprising the second preview image.
 32. The electronic device of claim 31, wherein the processor is further configured to cause the electronic device to generate the image movement stop instruction when: detecting an uplift after a flick operation on the first preview image when the third operation is the flick operation; detecting that a tap operation is performed again at any position on the viewfinder interface when the third operation is a sixth operation of tapping a third control indicating a second image movement direction on the viewfinder interface; detecting the uplift after a touch and hold operation when the third operation is a seventh operation of touching and holding a fourth control indicating the second image movement direction; and detecting the uplift after a drag operation when the third operation is an eighth operation of pressing and dragging a fifth control on the viewfinder interface.
 33. The electronic device of claim 25, wherein the first wide-angle camera is further configured to capture N frames of images, and wherein the processor is further configured to cause the electronic device to: obtain M1 frames of images through frame extraction from the N frames of images and obtain the second image from one of the M1 frames of images, wherein N is an integer greater than or equal to 1, and wherein M1 is an integer less than N; or obtain M2 frames of images through multi-frame image insertion into the N frames of images and obtain the second image from one of the M2 frames of images, wherein M2 is an integer greater than N.
 34. The electronic device of claim 25, wherein the third image block satisfies the following formulas: x′=x*cos(θ)−sin(θ)*y; and y′=x*sin(θ)+cos(θ)*y, wherein (x′, y′) is a first pixel on the third image block, wherein (x, y) is a second pixel on the second image block, and wherein θ is a preset rotation angle. 35.-45. (canceled) 